Selection Sort is also used for sorting smaller size array and simple as bubble sort but is better technique than that. You will have to select the smallest element in the array and then position it at the head. This process is iterated for the rest of the elements in the array, i.e. the second smallest element is placed below the first and so on.
Once the position of the element at the head is fixed, it will be ignored for the successive iterations, which in-turn decreases the time complexity and hence selection sort is faster than Bubble sort as well.
Here’s the code snippet for selection sort algorithm implementation in C programming language – Read the rest of this entry »
Archive for August, 2011
No Comments
Filed under:
Uncategorized