Utility functions for sorting vector.
use 0x2::compare;
Sorts a vector using quick sort algorithm.
public fun quick_sort<T>(data: &mut vector<T>)
Sorts a vector, returning a new vector with the sorted elements. The sort algorithm used is quick sort, it maybe changed in the future.
Sorts a vector using a custom comparison function. The comparison function should return true if the first element is greater than the second.
public fun sort_by_cmp<T>(data: &mut vector<T>, cmp: |(&T, &T)|bool)
Sorts a vector using a custom key function.
public fun sort_by_key<T, K>(data: &mut vector<T>, key: |&T|&K)