Skip to content

Commit d77f6e2

Browse files
author
Isaac Ramirez
committed
- rename Selection class for this keyword
1 parent 2bc6bbc commit d77f6e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/algorithms/selection-sort/selection-sort.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Selection {
4747
*/
4848
static isSorted (array, comparator = defaultComparator) {
4949
for (let i = 1; i < array.length; i++) {
50-
if (Selection.less(array[i], array[i - 1], comparator)) {
50+
if (this.less(array[i], array[i - 1], comparator)) {
5151
return false
5252
}
5353
}
@@ -79,12 +79,12 @@ class Selection {
7979
let min = i
8080

8181
for (let j = i + 1; j < n; j++) {
82-
if (Selection.less(array[j], array[min], comparator)) {
82+
if (this.less(array[j], array[min], comparator)) {
8383
min = j
8484
}
8585
}
8686

87-
Selection.exchange(array, i, min)
87+
this.exchange(array, i, min)
8888
}
8989
}
9090
}

0 commit comments

Comments
 (0)