4 ms·
It is not, it is actually closer to an insertion sort. The interesting part is that it often comes up when the one writing the algorithm doesn't know what he i
by GuB-42 2y ago
It is not, it is actually closer to an insertion sort.
The interesting part is that it often comes up when the one writing the algorithm doesn't know what he is doing, and yet, it works. It may look like a BubbleSort because it is a common wrong implementation of BubbleSort.
EDIT: insertion, not selection
- capitainenemo 2y agoYeah, section 3.2 of the PDF, titled '"Improving" the algorithm' notes that they have "rediscovered" insertion sort by simply adjusting the loop indices. (they also document a variant in 3.1 with similar indices tweaking which they describe as similar to an exchange sort)