Simply at each step it is found out where the smallest number in the array is located. By replacing this number with the number at the beginning of the series, the smallest numbers are selected and thrown to the beginning.
- It can be implemented as a stable sort
- Method Selection
The complexity of this algorithm is O(n2), because n numbers are processed at each step, and this process is repeated n times.
Type | Big(O) |
---|---|
Worst | O(n2) |
Average | O(n2) |
Memory | O(1) |