|
Notes > Computation and Algorithms > Selection Sort Algorithm
|
There are many different types of sorts that can be carried out both in the real world and computationally. One common type of sort is the Selection Sort. The Selection sort algorithm iterates over the values in an unordered list successively moving the lowest value to the front of the list. Each time an element is moved to the head of the list (or array) this is ignored by the following iterations. On the next iteration, the lowest value is then moved to the position in the list after the previous lowest value.
The following example show the steps taken in a selection sort. The bold numbers are the numbers which have been moved to the front of the list after being found to be the lowest value on each iteration.
5 7 3 9 2 1
--> 1 5 7 3 9 2
--> 1 2 5 7 3 9
--> 1 2 3 5 7 9
--> 1 2 3 5 7 9
--> 1 2 3 5 7 9
--> 1 2 3 5 7 9
Search for "Selection Sort" on:
Google |
Kelkoo |
Amazon |
eBay (UK) |
eBay (US)
Search for "Selection Sort" on the rest of Computing Students: Selection Sort
|
|
|