Xar module

quick_sort_simple

procedureSource

The same sort as quick_sort under another name, so code written for either works.

Example↗
array: Xar(int, 2, 4);
for value: int.[2, 1] xar_add(*array, value);
quick_sort_simple(array, (a: int, b: int) -> int { return a - b; });
assert(array[0] == 1);
xar_reset(*array);
quick_sort_simple :: (array: $T/Xar, f: (T.Element_Type, T.Element_Type) -> $R)

All three public names are this one heap sort.

Parameters

array: $T/Xar
f: (T.Element_Type, T.Element_Type) -> $R

See also