Вы находитесь на странице: 1из 1

Step

Step
Step
Step
Step

1
2
3
4
5

Set MIN to location 0


Search the minimum element in the list
Swap with value at location MIN
Increment MIN to point to next element
Repeat until list is sorted

Begin
Declare Array List
Size of the list n
for i = 0 to n
min = i
for j = i+1 to n
if list[j] < list[min] then
min = j;
end if
end for
/* swap the minimum element with the current element*/
if indexMin != i then
swap list[min] and list[i]
end if
end for
end procedure

Вам также может понравиться