/* partitions the elements a[k] ... a[j],
wrt the pivot and returns the position k */
{
int,
r;
{
= i; /*
starts from left end */
r = j; /*r starts from right end */
do
swap the records a[]
and a[r];
while (a[]
. key < pivot)
=
+ 1;
while (a[r] . key
pivot)
r = r - 1;
while(r);
return ();
}
}
![]() |