mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-06 12:07:09 +08:00
Finished changes requested by ayaankhan98.
This commit is contained in:
@@ -45,9 +45,9 @@ namespace sorting {
|
||||
*******************************************************************************/
|
||||
template <typename T>
|
||||
void selectionSort(std::vector<T> &arr, uint64_t len) {
|
||||
for (auto it = 0; it < len; ++it) {
|
||||
for (uint64_t it = 0; it < len; ++it) {
|
||||
int64_t min = it; // set min value
|
||||
for (auto it2 = it + 1; it2 < len + 1; ++it2) {
|
||||
for (uint64_t it2 = it + 1; it2 < len + 1; ++it2) {
|
||||
if (arr[it2] < arr[min]) { // check which element is smaller
|
||||
min = it2; // store index of smallest element to min
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user