We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 48e12fa + cd4aac3 commit c51e83bCopy full SHA for c51e83b
algorithms/sorting/select_sort.m
@@ -2,13 +2,13 @@
2
function arrayToSort = select_sort(arrayToSort)
3
for i=1:length(arrayToSort)
4
%%smallest element in the unsorted list
5
- minimun_index=i;
+ minimum_index=i;
6
for j=i+1:length(arrayToSort)
7
- if (arrayToSort(j) < arrayToSort(minimun_index))
8
- minimun_index=j;
+ if (arrayToSort(j) < arrayToSort(minimum_index))
+ minimum_index=j;
9
endif
10
endfor
11
-%%replace the element with the minimun value of the unsorted array
12
- 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]);
13
14
endfunction
0 commit comments