selection sort optimization
This commit is contained in:
parent
156f7a67f4
commit
dba60f03ae
@ -45,9 +45,11 @@ public class Selection<T extends Comparable<T>> extends Sort<T> {
|
|||||||
min = j;
|
min = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (min != i) {
|
||||||
swap(nums, i, min);
|
swap(nums, i, min);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user