Skip to content

Commit 890180c

Browse files
authored
Merge pull request #60 from christianbender/clean_up_quicksort.js
clean up
2 parents 3748fe0 + 7d3fa40 commit 890180c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/js/algorithms/sorting/quicksort.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ function partition(array, left, right, compareFn) {
44
const pivot = array[Math.floor((right + left) / 2)];
55
let i = left;
66
let j = right;
7-
// console.log('pivot is ' + pivot + '; left is ' + left + '; right is ' + right);
7+
88
while (i <= j) {
99
while (compareFn(array[i], pivot) === Compare.LESS_THAN) {
1010
i++;
11-
// console.log('i = ' + i);
1211
}
1312
while (compareFn(array[j], pivot) === Compare.BIGGER_THAN) {
1413
j--;
15-
// console.log('j = ' + j);
1614
}
1715
if (i <= j) {
18-
// console.log('swap ' + array[i] + ' with ' + array[j]);
1916
swap(array, i, j);
2017
i++;
2118
j--;

0 commit comments

Comments
 (0)