From 28288d80bea1cc76d05d3c35e216eb8fd818c2f9 Mon Sep 17 00:00:00 2001 From: Lajat5 Date: Sat, 23 Oct 2021 09:03:33 +0000 Subject: [PATCH] Fix #3 --- 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 eeeba4e4b..12a7c8bb2 100644 --- a/sorting/selection_sort_iterative.cpp +++ b/sorting/selection_sort_iterative.cpp @@ -39,7 +39,7 @@ namespace sorting { /****************************************************************************** * @brief The main function which implements Selection sort - * @param arr vector to be sorted:-> template + * @param arr vector to be sorted * @param len length of vector to be sorted * @returns void *******************************************************************************/ @@ -47,7 +47,7 @@ namespace sorting { void selectionSort(std::vector &arr, uint64_t len) { for (uint64_t it = 0; it < len; ++it) { uint64_t min = it; // set min value - for (uint64_t it2 = it + 1; it2 < len + 1; ++it2) { + for (uint64_t it2 = it + 1; it2 < len; ++it2) { if (arr[it2] < arr[min]) { // check which element is smaller min = it2; // store index of smallest element to min }