4 ms·
Then think trice. Selection sort gets its name from doing work to find, select, the overall smallest element. This algorithm just takes the element at position
by jonsen 5y ago
Then think trice. Selection sort gets its name from doing work to find, select, the overall smallest element. This algorithm just takes the element at position i and inserts it at the so far right place in the sorted subarray to the left of i.
It's an inefficient (and somewhat obscure) variant of insertion sort.
- justicezyx 5y agoBut overall it's not surprising to me...