mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5e0e571a5c
@ -23,9 +23,7 @@ export default class SelectionSort extends Sort {
|
||||
|
||||
// If new minimum element has been found then swap it with current i-th element.
|
||||
if (minIndex !== i) {
|
||||
const tmp = array[i];
|
||||
array[i] = array[minIndex];
|
||||
array[minIndex] = tmp;
|
||||
[array[i], array[minIndex]] = [array[minIndex], array[i]];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user