feat: adjust swap grammar (#175)

* feat: adjust swap grammar

* fix: grammar
This commit is contained in:
zoomdong
2020-05-23 14:01:41 +08:00
committed by GitHub
parent e9d4da4ef5
commit b2f6471b89
7 changed files with 10 additions and 29 deletions

View File

@@ -21,9 +21,7 @@ function selectionSort (items) {
if (min !== i) {
// After each pass, if the current min num != initial min num, exchange the position.
// Swap the numbers
var tmp = items[i]
items[i] = items[min]
items[min] = tmp
[items[i], items[min]] = [items[min], [items[i]]]
}
}
}