SELECTION SORT

Selection sort is based on the idea of finding smallest or largest element in unsorted array and placing it at the correct position in the sorted array.This will result into increasing the length of the sorted array by one and decreasing the length of unsorted array by one after each iteration.

EXAMPLE:

To understand the selection sort ,lets consider an unsorted array[1,10,23-2] and discuss each step taken to sort the array in ascending order. In every pass, smallest elements is found in the unsorted array and swapped with first element of unsorted array .

Steps:-