Sorting Algorithms — Boring Until You Add Sound 118
An anonymous reader writes "Anyone who's ever taken a programming course or tried to learn how to code out of a book will have come across sorting algorithms. Bubble, heap, merge — there's a long list of methods for sorting data. The subject matter is fairly dry. Thankfully, someone has found a way to not only make sorting more interesting, but easier to remember and understand, too."
Sorting Out Sorting (Score:3, Interesting)
Re:Everything is better with sound (Score:0, Interesting)
Ted Bundy would disagree
As a decided non-expert... (Score:3, Interesting)
One thing this seems to show me (at least the video does)
the rate of completion - how much is sorted by each point in the process
the algorithms seem to all do that a bit differently; some have most of the work completed in the beginning, some in the end.
Most seem to take one piece of data and plunk it right in order; the merge sort seems to be the only one with intermediate groupings.
and there's one final pass to make sure the data's in order.
I notice different sorting processes are appropriate for different RL sorting situations.
Diagnostics (Score:5, Interesting)
One interesting application of such audible/visual representations could be for diagnostic reasons.There are numerous cases where experienced observers can spot patterns or anomalies in patterns that machine algorithms have trouble with.
One example I was involved in years ago at Boeing was a tool for diagnosing a large switch matrix used in a piece of automated test equipment. Each output could be tied to a high, low or open signal, driven from a controller over an HPIB bus. Failure modes included not only an output stuck high, low or open, but address bus problems where some lines would cause passive failures or activate more than one pin. After watching a poor engineer go through a suspect matrix panel for over a day, entering a command on the bus, finding the pin on a patch panel, sticking a voltmeter on it, over and over a few thousand times, we came up with a solution. Bi-colored LEDs wired to a patch panel and a program to exercise the matrix with a series of address patterns. An observer could spot a single bad switch or a hung address bus line in a few seconds just by looking for an anomaly in a couple of checkerboard and other patterns.
Bugged bubble sort? (Score:3, Interesting)
Visual Aids (Score:1, Interesting)
I found http://www.sorting-algorithms.com/ to be useful for looking at how sorting works, too.
Also fun: porttwiddle (Score:1, Interesting)
http://wolfbell.com/projects/index.html [wolfbell.com] - Porttwiddle is an add-on module to a one-disk linux router project that will play sounds of different frequency depending on the port number. You'll never miss a portscan again! ;-)
Sorting real objects (Score:4, Interesting)
As an undergrad I worked in the university library to earn a bit of spending money, and one of my tasks was sorting books to put them back on the shelves. My colleagues used selection sort. I didn't.
I did a first pass through the books. Two piles, typically A-L, M-Z. Then a second pass, A-D, E-L, M-R, S-Z. And so on, until the piles were small enough I could go through them and put them on the shelf in order.
How many people do you know who actually use quicksort to sort real objects?
...laura
Re:The sound of bubble sort (Score:3, Interesting)
And that's not uncommon. There are plenty of circumstances where you may have a large number of short lists floating around. Say, a list of a person's children, which will be less than 4 in 99% of cases and even the extreme cases aren't going to kill you. There may be many instances of the list, but each will be small.
Sorting those lists via some O(n^2) sort is lower overhead than building up fancy data structures. Especially if you're building the lists incrementally, such as via an insertion sort (much like an incremental bubble sort).
Re:Sorting Out Sorting (Score:2, Interesting)
My initial reaction was "Really? Seriously?? How does this make the algorithm any more interesting, easier to understand, or easier to remember? I mean hey - I like 80's console-sounds as much as the next guy, but they're not really adding anything."
Then it hit me that (apparently) many people haven't seen the algorithms visualized like this before. As someone who's been teaching this stuff for years, I've always handed out links to visualizations like this (even if they did lack the retro-hip sound effects :) ). As a matter of fact, I think that one of the first big demonstrations of Java was an applet that demonstrated :) ]
various sorting algorithms [citation needed
Anyways, if you're interested in this sort of thing, the link I've been using is:
http://www.sorting-algorithms.com/ [sorting-algorithms.com]
I've heard good things about this place, but haven't looked through it extensively:
http://algoviz.org/ [algoviz.org]
(You know, in all the years I've been on Slashdot, I don't think I've ever wanted to create a new top-level post instead of responding to someone else's comment.... until now. Which is why I can't find the button to do so. I'd love for someone to (politely, with good humor) point out the obvious button that I'm missing)