Selection sort

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]


  Created Fri Oct 30 13:52:49 EET 2009 - Powered by SVG-hut