Rearranges the array of extended ASCII strings in ascending order.
(a: &mut [T])
| 88 | { |
| 89 | /// Rearranges the array of extended ASCII strings in ascending order. |
| 90 | pub fn sort(a: &mut [T]) { |
| 91 | let n = a.len(); |
| 92 | if n > 0 { |
| 93 | let mut aux = vec![a[0]; n]; |
| 94 | Self::do_sort(a, 0, n - 1, 0, &mut aux); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /// sort from a[lo] to a[hi], starting at the d-th character |
| 99 | fn do_sort(a: &mut [T], lo: usize, hi: usize, d: usize, aux: &mut [T]) { |