From 84710a3fcbfd98284e0d5fe6b656aae6b1fb0e3b Mon Sep 17 00:00:00 2001 From: Andres Contreras Date: Wed, 17 Jun 2020 12:07:31 -0500 Subject: [PATCH 1/2] fix typo of minimum --- algorithms/sorting/select_sort.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/sorting/select_sort.m b/algorithms/sorting/select_sort.m index af03838..62447b9 100644 --- a/algorithms/sorting/select_sort.m +++ b/algorithms/sorting/select_sort.m @@ -2,7 +2,7 @@ function arrayToSort = select_sort(arrayToSort) for i=1:length(arrayToSort) %%smallest element in the unsorted list - minimun_index=i; + minimum_index=i; for j=i+1:length(arrayToSort) if (arrayToSort(j) < arrayToSort(minimun_index)) minimun_index=j; From cd4aac39921cc3f9866d80256a01e4b70cd37de7 Mon Sep 17 00:00:00 2001 From: andrescontreras96 Date: Wed, 17 Jun 2020 12:16:43 -0500 Subject: [PATCH 2/2] fix typo --- algorithms/sorting/select_sort.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/algorithms/sorting/select_sort.m b/algorithms/sorting/select_sort.m index 62447b9..cbba08f 100644 --- a/algorithms/sorting/select_sort.m +++ b/algorithms/sorting/select_sort.m @@ -4,11 +4,11 @@ %%smallest element in the unsorted list minimum_index=i; for j=i+1:length(arrayToSort) - if (arrayToSort(j) < arrayToSort(minimun_index)) - minimun_index=j; + if (arrayToSort(j) < arrayToSort(minimum_index)) + minimum_index=j; endif endfor -%%replace the element with the minimun value of the unsorted array - arrayToSort([i minimun_index]) = arrayToSort([minimun_index i]); +%%replace the element with the minimum value of the unsorted array + arrayToSort([i minimum_index]) = arrayToSort([minimum_index i]); endfor endfunction \ No newline at end of file