HN Hall of Fame Weekly email

Is this the simplest (and most surprising) sorting algorithm?

arxiv.org Research & data Research papers Computer science Candidate
Screenshot of arxiv.org captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 3 calendar years, with breakout response in 2 of them.

submissions
4
submitters
4
observed span
2021–2025
peak thread · 313 comments
615 pts
latest 20+ return · 2025-02-24
130 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

High level description of why it sorts: The inner loop takes an array and an index i in the array, and rearranges the array to put the largest value at index i. This is done in such a way that if the sub-array up to but not including i is sorted, then afterwords the sort will be extended such that the sub-array up to and including i will be sorted. The outer loop says, just call in to the inner…

dilap·615-point thread·

Lots of people in this thread saying that it's just an unoptimised Bubble Sort. No, it really isn't. In bubble sort you see if two things are the wrong way round and it they are then you swap them. This does that (sort of) the "wrong way round". In Bubble Sort your indices are always i<j ... here they aren't. In Bubble Sort you only ever compare adjacent items. Here you don't. This really, really isn't Bubble Sort, unoptimised or…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
749

reference only — not used in Hall rules or ranking

Total comments
431

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2021-10-05Is this the simplest (and most surprising) sorting algorithm?First breakout · Best threadColinWright615313
2023-03-01The “I can't believe it can sort” algorithmBiteCode_dev20
2025-01-17Is this the simplest (and most surprising) sorting algorithm?fanf220
2025-02-24Is this the simplest (and most surprising) sorting algorithm ever? (2021)Latest 20+ point returngnabgib130118