There was an error while loading. Please reload this page.
1 parent 0ca2bc9 commit 1400e7cCopy full SHA for 1400e7c
include/quick_sort.h
@@ -74,8 +74,8 @@ namespace alg {
74
quicksort(list, begin, pivot_idx-1);
75
quicksort(list, pivot_idx+1, end);
76
} else if ( begin + 1 == end) {
77
-if (list[begin + 1] > list[end])
78
-swap(list[begin + 1], list[end]);
+if (list[begin] > list[end])
+swap(list[begin], list[end]);
79
}
80
81
0 commit comments