It is a sorting technique that is based on the partitioning of array into two parts, sorted and unsorted.
The process is:-
1) Find minimum element in unsorted array.
2) Swap the element at the end of sorted array.
when i=0 we don't have any sorted array so element will be replaced from first element later the sorted array end will growas the index.
underline elements are sorted array, the length is increasing with each minimum element added at the end.minimum element11