class ARRAY_SORT{ELT}
Flattened version is
here
Public
Features
insertion_sort(inout ar:ARRAY{ELT})
****
stable sort.
insertion_sort(inout ar:ARRAY{ELT},lt:ROUT{ELT,ELT}:BOOL)
****
stable sort.
insertion_sort_range(inout ar:ARRAY{ELT},l,u:CARD)
insertion_sort_range(inout ar:ARRAY{ELT},l,u:CARD, lt:ROUT{ELT,ELT}:BOOL)
****
sort by increasing order "<" with respect to `lt'.
lt_rev(a,b:ELT,lt:ROUT{ELT,ELT}:BOOL):BOOL
****
">" with respect to lt(<).
quick_sort(inout ar:ARRAY{ELT})
****
Use quicksort to permute the elements of self so that
it is sorted by increasing order "<" with respect to `elt_lt'. Self may be void.
quick_sort(inout ar:ARRAY{ELT}, lt:ROUT{ELT,ELT}:BOOL)
****
Use quicksort to permute the elements of self so that
it is sorted by increasing order "<" with respect to `lt'. Self may be void.
quicksort_range(inout ar:ARRAY{ELT},l,u:CARD)
quicksort_range(inout ar:ARRAY{ELT}, l, u:CARD, lt:ROUT{ELT,ELT}:BOOL)
sorted_insert(ar:ARRAY{ELT}, e:ELT):ARRAY{ELT}
****
assume ar is sorted by increasing order "<".
sorted_insert(ar:ARRAY{ELT}, e:ELT, lt:ROUT{ELT,ELT}:BOOL):ARRAY{ELT}
****
assume ar is sorted by increasing order "<"(with lt).
sorted_rev_insert(ar:ARRAY{ELT}, e:ELT):ARRAY{ELT}
****
assume ar is sorted by decreasing order ">".
sorted_rev_insert(ar:ARRAY{ELT}, e:ELT, lt:ROUT{ELT,ELT}:BOOL):ARRAY{ELT}
xxquicksort_range(inout ar:ARRAY{ELT}, l, u:CARD, lt:ROUT{ELT,ELT}:BOOL)
Private
const quicksort_limit:CARD:=20;
****
When to stop the quicksort recursion and switch to insertion sort.
The Sather Home Page