☰
sorted_array
container.sorted_array
Type Parameters
array element typeFunctions
§group the elements of this sequence by a key of type K
f determines the key of an element
Type Parameters
array element typeFunctions
§group the elements of this sequence by a key of type K
f determines the key of an element
array element type
Functions
§group the elements of this sequence by a key of type K
f determines the key of an element
§
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
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).