From bcf294bae5afd2a718d4e69bd7d42782829a7416 Mon Sep 17 00:00:00 2001 From: Lajat5 Date: Thu, 21 Oct 2021 17:27:33 +0000 Subject: [PATCH] Finished changes requested by ayaankhan98. --- sorting/selection_sort_iterative.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sorting/selection_sort_iterative.cpp b/sorting/selection_sort_iterative.cpp index f1bd00a93..90caeed48 100644 --- a/sorting/selection_sort_iterative.cpp +++ b/sorting/selection_sort_iterative.cpp @@ -45,9 +45,9 @@ namespace sorting { *******************************************************************************/ template void selectionSort(std::vector &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 }