File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 70
70
71
71
``` js
72
72
function quickSort (array , start , end ) {
73
- if (end - start < 2 ) {
73
+ if (end - start < 1 ) {
74
74
return ;
75
75
}
76
76
const target = array[start];
77
77
let l = start;
78
78
let r = end;
79
79
while (l < r) {
80
- while (l < r && array[r] > target) {
80
+ while (l < r && array[r] >= target) {
81
81
r-- ;
82
82
}
83
83
array[l] = array[r];
Original file line number Diff line number Diff line change 62
62
63
63
``` js
64
64
function quickSort (array , start , end ) {
65
- if (end - start < 2 ) {
65
+ if (end - start < 1 ) {
66
66
return ;
67
67
}
68
68
const target = array[start];
69
69
let l = start;
70
70
let r = end;
71
71
while (l < r) {
72
- while (l < r && array[r] > target) {
72
+ while (l < r && array[r] >= target) {
73
73
r-- ;
74
74
}
75
75
array[l] = array[r];
You can’t perform that action at this time.
0 commit comments