Hide text Hide pseudo-code | |
Apply selection sort to the Input table below.
| SelectionSort(a) 1 for i = 0 to n-2 do 2 min = i 3 for j = i+1 to n-1 do 4 if (a[j] < a[min]) do 5 min = j 6 swap a[i] and a[min] |
TRAKLA2 | Index |
Hide text Hide pseudo-code | |
Apply selection sort to the Input table below.
| SelectionSort(a) 1 for i = 0 to n-2 do 2 min = i 3 for j = i+1 to n-1 do 4 if (a[j] < a[min]) do 5 min = j 6 swap a[i] and a[min] |