You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe the array in the test is a descending array,so the partition function should following like this:
function partition(arr, start, end) {
let i = start;
let pivot = arr[end];
for (let j = start; j < end; j++) {
if (arr[j] > pivot) {
swap(arr, i, j);
i += 1;
}
}
swap(arr, i, end);
return i;
}
The text was updated successfully, but these errors were encountered:
Maybe the array in the test is a descending array,so the partition function should following like this:
The text was updated successfully, but these errors were encountered: