Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is being likened to bubblesort in various places but your description (which I quite like) makes it seem like quicksort with an intentionally bad (worst possible?) bifurcation.


Well, it's not really dividing, sorting, and merging, so I wouldn't say it's too similar to quicksort.

It's basically insertion sort, but with the curious property that the last value of the sorted subarray immediately and always has the correct value, and we then "gently" insert new values into the sorted subarray.

smusamashah linked to a nice sort visualization.

https://xosh.org/VisualizingSorts/sorting.html#IYZwngdgxgBAZ...

Tap the "Insertion Sort" checkbox on the right, and then the "Start" button below that.

You can see how both sorts are slowly constructing a sorted subarray, but this sort has the interesting property that the tail of the sorted subarray immediately obtains its maximum brightness, and new values are gently incorporated into the array, while the insertion sort tail is just the brightest value encountered so far, and the latest value is "abrutly" sifted down into its appropriate place.

It feels like this sort might minimize some kind of "sort entropy" metric? I.e., visually it looks very smooth. Each step along the way to sorted is very small.


> https://xosh.org/VisualizingSorts/sorting.html#IYZwngdgxgBAZ...

That is the most beautiful thing in CS I've ever seen.


This visualization tool is amazing.

Is rain just the atmosphere running bubble sort ;) ?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: