Re:Is this the simplest (and most surprising) sorting algori...
by thaumasiotes on Tuesday February 25, 2025 @02:09AM
(#43169084)
Here's an algorithm (in Python) that is exactly equivalent to the one in the paper:
The first pass of this algorithm (bubbling high values down, one time only) may do different things than the first pass of the paper's algorithm, but that's not relevant.
[ Parent
| on HN ]
Re:Is this the simplest (and most surprising) sorting algori...
by chowells on Tuesday February 25, 2025 @04:41AM
(#43169933)
All comparisons and swaps in the code you quoted are made between adjacent elements. It's local in a way that behaves very nicely for an external sort on a tape drive.
The code in the paper compares and swaps non-adjacent elements nearly every time. It is absolutely horrible for an external sort on a tape drive. It's just not a bubble sort, nor is it sort of like one in any key behavioral detail.