Walk-through: Selection Sort Algorithm

How do you sort?

Selection Sort Algorithm

Selection Sort Pseudocode

SelectionSort(arr) DECLARE n <-- arr.length; FOR i to n - 1 DECLARE min <-- i FOR j is i + 1 to n if (arr[j] < arr[min]) min <-- j DECLARE temp <-- arr[min] arr[min] <-- arr[i] arr[i] <-- temp


Complexity Analysis


Learn to Code. Get a Job. Start Here! Learn more at www.codefellows.org