Hacker News new | ask | show | jobs
by donatj 1453 days ago
Is this not a standard sorting algorithm? If I'm not mistaken this is my coworkers go to sort when writing custom sorts.
1 comments

It manages to be more inefficient than most, and will even disorder and then reorder an already sorted input. Bubble sort (a very low bar to beat) doesn't even do that. If you've only got a small number of items, it doesn't matter unless you're sorting a small number of items a large number of times.