diff --git a/algorithms/sorting/select_sort.m b/algorithms/sorting/select_sort.m index af03838..cbba08f 100644 --- a/algorithms/sorting/select_sort.m +++ b/algorithms/sorting/select_sort.m @@ -2,13 +2,13 @@ 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; + 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