Selection sort is a simple and efficient sorting algorithm that works by repeatedly selecting the smallest (or largest) element from the unsorted portion of the list and moving it to the sorted portion of the list.
The algorithm repeatedly selects the smallest (or largest) element from the unsorted portion of the list and swaps it with the first element of the unsorted portion.
This process is repeated for the remaining unsorted portion of the list until the entire list is sorted.
2.Compare minimum with the second element.
If the second element is smaller than minimum, assign the second element as minimum.
Compare minimum with the third element.
Again, if the third element is smaller, then assign minimum to the third element otherwise do nothing.
The process goes on until the last element.
4.For each iteration, indexing starts from the first unsorted element.
Step 1 to 3 are repeated until all the elements are placed at their correct positions.






