What is Selection Sort?


Selection Sort is a simple comparison-based sorting algorithm.

Idea:

Think of it like:

“Pick the smallest card from the table and place it in order.”


Step-by-step Example

Given array:

[64, 25, 12, 22, 11]

Pass 1

[11, 25, 12, 22, 64]

Pass 2