Quicksort (with bounded stack usage)
procedure sort( var r : ArrayToSort; lo, up : integer ); var i, j : integer; tempr : ArrayEntry; begin while up>lo do begin i := lo; j := up; tempr := r[lo]; {*** Split file in two ***} while i
tempr.k do j := j-1; r[i] := r[j]; while (i
C
source (413.sort.c)
Pascal
source (413.sort.p)
©
Addison-Wesley
Publishing Co. Inc.