Selection sort is a sorting algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning of the unsorted part. It is used when only O(N) swaps can be made and when memory write is a costly operation