Crate double_sortsource · [−]
Double sort works by separating the elements into pairs of two called nodes, this allows to order the two elements within the node extremely fast since it’s a 1:1 memory swap.
Grouping elements by nodes allows a simple loop statement to order the whole vector in n/2 - 1 reads maximum by utilizing BinaryHeaps
[dependencies] double_sort = "1.2.0"
Works in the same way that double_sort does but utilizes BinaryHeaps. This provides a faster but less logarithmic sort since it only shaves half heap.pop() runs.
Sorts a vector of elements by pairing them and ordering them by the lowest number, then exchanging elements with neighbours until sorted.