Hacker News new | ask | show | jobs
by cgijoe 2086 days ago
Is it fast? I mean like, compared to QuickSort or others. Honestly asking -- I've not heard of Bead Sort before.
2 comments

Runtime is proportional to g (the local gravitational constant), so if you find it's too slow, you can just run your algorithm in a centrifuge or on Jupiter to speed it up.
Preparation is the killer though. Setup time for bead sort linearly scales with the sum of the values of the array. However, depending on your implementation setup and execution can be parallelized (for example on a Connect Four board in its default vertical orientation in an environment with gravity).
The numbers being sorted in Bead Sort are base 1, which means it's never faster than O[n] where n is not the number of numbers being sorted, but the largest number being sorted.

That means it won't scale well and is impractical for sorting realistic numbers (barring a lot of special-purpose parallel hardware).