This will precompute the keys of all items up front, which may make it more
efficient than using sort with comparing, which will call
the key function 2n log n times.
This internally uses an auxiliary array of array indices and keys to permute
the input array in place, avoiding a copy of the items array.
Sorts an array on keys in place.
This will precompute the keys of all items up front, which may make it more efficient than using sort with comparing, which will call the key function 2n log n times.
This internally uses an auxiliary array of array indices and keys to permute the input array in place, avoiding a copy of the items array.