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 6cfc039 commit 10fdeb4Copy full SHA for 10fdeb4
algorithms/sorting/bubble_sort.js
@@ -29,7 +29,7 @@ var bubbleSort = function (a, comparatorFn) {
29
var comparator = new Comparator(comparatorFn);
30
var n = a.length;
31
var bound = n - 1;
32
- var check = 0;
+ var check = false;
33
for (var i = 0; i < n - 1; i++) {
34
var newbound = 0;
35
for (var j = 0; j < bound; j++) {
@@ -38,10 +38,10 @@ var bubbleSort = function (a, comparatorFn) {
38
a[j] = a[j + 1];
39
a[j + 1] = tmp;
40
newbound = j;
41
- check = 1;
+ check = true;
42
}
43
44
- if (0 === check)
+ if (!check)
45
return a;
46
bound = newbound;
47
0 commit comments