2 ms·
I'm reminded of Bead Sort [1], which is an amusing physical sorting algorithm for integers represented in unary. The sorting can be done in O(sqrt(n)) time (tim
by versteegen 10y ago
I'm reminded of Bead Sort [1], which is an amusing physical sorting algorithm for integers represented in unary. The sorting can be done in O(sqrt(n)) time (time taken for the beads to fall under gravity; n is input size in unary), but that doesn't include the time needed to load the input and read the result.
[1] https://en.wikipedia.org/wiki/Bead_sort https://en.wikipedia.org/wiki/Bead_sort