sorted_array
container.sorted_array
Type Parameters
Functions
group the elements of this sequence by a key of type K
f determines the key of an element
f determines the key of an element
0.095dev (2025-08-15 12:02:22 GIT hash 301b5b75e77076d091b38f555473f9f0e31e5b5c built by fridi@fzen)
This takes an unsorted array and a compare function as an arguments and
returns a sorted one.
Non-mutating heap sort is used internally. This gives guaranteed performance in
O(n log n) comparisons and assignments for an array of size n.
This is a little wasteful on allocated memory, which is also O(n log n) since
partially sorted arrays are thrown away. This might be improved to use an
in-place heap sort to bring allocated memory down to O(n).