TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bead Sort

99 pointsby kkaranthover 4 years ago

12 comments

munk-aover 4 years ago
I absolutely loved learning about Bead Sort when I was in Uni. I was taking a class on algorithm design and Big-O notation and ended up reading through the sorting algorithms page on wikipedia[1] and then wandering off the garden path investigating a few.<p>There are several amusing ways that standard algorithmic analysis has been subverted with creative solutions (i.e. if you subscribe to the many-worlds theory then bogosort is always O(1) for at least one universe - you just need to discard the incorrect universes) but beadsort stood out as a really fun way to turn the problem on its head - the fact that it appears to be inspired from misusing an abacus just makes it even better.<p>It&#x27;s a great example of why having people who can think outside of the box can be a good asset - approaching problems from unexpected directions can yield valuable and novel solutions.<p>1. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sorting_algorithm#Comparison_of_algorithms" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sorting_algorithm#Comparison_o...</a>
评论 #24668453 未加载
评论 #24667861 未加载
MaxBarracloughover 4 years ago
I&#x27;m surprised that this was only discovered in 2002. [0] Neat.<p>Reminds me of <i>spaghetti sort</i> [1], but bead sort is much cleverer.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bead_sort" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bead_sort</a><p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Spaghetti_sort" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Spaghetti_sort</a>
评论 #24667870 未加载
ogre_codesover 4 years ago
This is one of those cases where adding extraneous information confuse the illustration. It took me 2-3 times through before I figured out that color was completely irrelevant.
评论 #24667958 未加载
评论 #24667990 未加载
p1mrxover 4 years ago
This needs a pause button, or at least some way to view the starting configuration. It&#x27;s hard to think when everything is moving.
vimaxover 4 years ago
The optimal complexity of a sorting network of fixed width numbers is bound by depth O(log n). [1]<p>I&#x27;m not sure how to go about analyzing bread sort, but it does seem bound by aligning and inserting the beads into each column which would be at least O(log n), the number of digits. But, I&#x27;d be surprised if it is optimal.<p>[1] <a href="https:&#x2F;&#x2F;www.researchgate.net&#x2F;publication&#x2F;220329153_An_Optimal_Hardware-Algorithm_for_Sorting_Using_a_Fixed-Size_Parallel_Sorting_Device" rel="nofollow">https:&#x2F;&#x2F;www.researchgate.net&#x2F;publication&#x2F;220329153_An_Optima...</a>
29athrowawayover 4 years ago
Nothing better than sleep sort.
评论 #24667667 未加载
评论 #24670363 未加载
评论 #24668144 未加载
plasticchrisover 4 years ago
This is delightful! The actual implementation in a digital system seems to be a special case of radix sort, but it doesn&#x27;t take away from the fun :)
cgijoeover 4 years ago
Is it fast? I mean like, compared to QuickSort or others. Honestly asking -- I&#x27;ve not heard of Bead Sort before.
评论 #24669288 未加载
评论 #24676181 未加载
rmelhemover 4 years ago
sorry if its offtopic but does anyone here have any experience with librarysort?<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Library_sort" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Library_sort</a>
评论 #24669658 未加载
google234123over 4 years ago
Go Utes! Loved the animation! Thanks for sharing.
xiaodaiover 4 years ago
Radix sort and counting sort are what ppl should be using.
adenozineover 4 years ago
I&#x27;m almost certain this already exists under a different name, like a columnar sort or something. Can&#x27;t be bothered to Google on mobile, but this is 100000% not novel<p>Visual is nice though
评论 #24667292 未加载