We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03a31f1 commit 903480dCopy full SHA for 903480d
src/strings/quick3.rs
@@ -28,6 +28,7 @@ where
28
Self::do_sort(a, 0, n.saturating_sub(1), 0);
29
}
30
31
+ /// 3-way string quicksort a[lo..hi] starting at d-th character
32
fn do_sort(a: &mut [T], lo: usize, hi: usize, d: usize) {
33
if hi <= lo + CUTOFF {
34
sort::insert::sort_dth(a, lo, hi, d);
@@ -65,11 +66,13 @@ impl<T> Quick3Way<T>
65
66
where
67
T: Ord + Clone,
68
{
69
+ /// Rearranges the array in ascending order, using the natural order.
70
pub fn sort(a: &mut [T]) {
71
let n = a.len();
72
Self::do_sort(a, 0, n.saturating_sub(1));
73
74
75
+ /// quicksort the subarray a[lo .. hi] using 3-way partitioning
76
fn do_sort(a: &mut [T], lo: usize, hi: usize) {
77
if hi <= lo {
78
return;
0 commit comments