Visualize Selection Sort step by step. Watch the algorithm scan for the minimum element each pass and swap it into position, making the sorted prefix grow one element at a time.
Selection Sort repeatedly selects the minimum element from the unsorted portion and places it at the beginning.
Search the unsorted part of the array to find the minimum element.
Swap the found minimum element with the first element of the unsorted part.
Move the boundary of the sorted region one element to the right.
Repeat until the entire array is sorted.
Selection Sort makes the minimum number of swaps (exactly N-1), which can be an advantage when swap cost is high.