Skip to content

Commit c51e83b

Browse files
authored
Merge pull request #32 from AndresContreras96/select-sort-contribution
Select sort typo fix
2 parents 48e12fa + cd4aac3 commit c51e83b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

algorithms/sorting/select_sort.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
function arrayToSort = select_sort(arrayToSort)
33
for i=1:length(arrayToSort)
44
%%smallest element in the unsorted list
5-
minimun_index=i;
5+
minimum_index=i;
66
for j=i+1:length(arrayToSort)
7-
if (arrayToSort(j) < arrayToSort(minimun_index))
8-
minimun_index=j;
7+
if (arrayToSort(j) < arrayToSort(minimum_index))
8+
minimum_index=j;
99
endif
1010
endfor
11-
%%replace the element with the minimun value of the unsorted array
12-
arrayToSort([i minimun_index]) = arrayToSort([minimun_index i]);
11+
%%replace the element with the minimum value of the unsorted array
12+
arrayToSort([i minimum_index]) = arrayToSort([minimum_index i]);
1313
endfor
1414
endfunction

0 commit comments

Comments
 (0)