The selection sort algorithm sorts an array by repeatedly finding the minimum element (for ascending order) from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.
#include |
enter 5 elements of array : 12 23 34 2 45 Array Element After Sorting.... 2 12 23 34 45 |