Slashdot Mirror


Sorting Algorithms — Boring Until You Add Sound

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."

15 of 118 comments (clear)

  1. QuickBasic did this by Bananenrepublik · · Score: 3, Informative

    Anybody who did their first programming steps with QuickBasic will remember that it came with a demo that did just this. Anyway, the videos are still fun to watch.

    1. Re:QuickBasic did this by commodore64_love · · Score: 4, Informative

      Ditto MS BASIC 7(?) on the old 1985 Amiga - included demos with sound.

      Plus TV shows, especially scifi ones, do this all the time. The computers don't have to make noise but the audio engineer added the sound to keep the show from being dull.

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
  2. Sorting Out Sorting by SilverEyes · · Score: 3, Interesting

    Does anyone remember "Sorting Out Sorting" (1980)? Best sorting video ever made. This is the same thing, it's good, but it was done thirty years ago. Also, "Pointy Does Pointers" (not an adult film, I swear).

    --
    Interesting.
    1. Re:Sorting Out Sorting by SilverEyes · · Score: 3, Funny

      I did watch it again after I posted my comment, I was wrong. I misremembered the video. The annoying sounds are unrelated to the algorithm.

      This guy did have not-annoying sounds related to the algorithm. Also the quality is much higher.

      --
      Interesting.
  3. No Quicksort? by gus+goose · · Score: 4, Insightful

    Feel like I'm complaining about a poll with a missing option, but, honestly ....:(

    gus

    --
    .. if only.
    1. Re:No Quicksort? by kvezach · · Score: 3, Insightful

      No thinking outside of the box -- no radix sort? Seriously!

    2. Re:No Quicksort? by Tanktalus · · Score: 3, Funny

      I was looking for Bogosort myself, actually.

  4. Shear Sort by jellomizer · · Score: 3, Insightful

    The Shear Sort is one of my favorite sorts out there. Although you will need an orchestra to play it.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  5. Try it with people by twoshortplanks · · Score: 5, Funny
    It's always more fun to do this with real people (sort by height, for example). The London Perl Mongers tried this as a drinking game: You get enough people down the pub (or, in one this case, outside a bar in portugal during conference season) and apply booze. Then bubble sort them as a group (lots of shouting Stay! Switch!.) Add drinking penalties when people screw up the algorithm. You get the idea.

    There's a video on the internet somewhere. Free pint to the first person to find it.

    --
    -- Sorry, I can't think of anything funny to say here.
  6. The sound of bubble sort by Anonymous Coward · · Score: 5, Funny

    That's strange. When I listen to the sound of bubble sort all I hear is one of my college professors threatening to hunt me down and kill me in my sleep if I ever use it.

  7. Diagnostics by PPH · · Score: 4, 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.

    --
    Have gnu, will travel.
  8. Re:As a decided non-expert... by pjt33 · · Score: 4, Informative

    The heap sort actually has intermediate structure. If you watch carefully you can see that it has two phases, the first much shorter than the second. However, the structure isn't as visibly obvious as for merge sort.

    If it had showed quicksort (I can't understand why it didn't) then you'd have seen some intermediate structure there too.

    I also noticed that the selection sort wasn't as good as it could be. It's more efficient to select the largest and the smallest unsorted values on each pass - you halve the number of passes, and on each pass you do 50% more work, so overall it's a 25% improvement.

  9. Re:Sorting is a waste of time by mea37 · · Score: 5, Insightful

    If you think all that time examining sorting algorithms was intended to teach you about sorting, then you indeed missed the point. Programming courses spend a lot of time on sorting because it is a common task that can be easily understood, but for which there are a lot of different algorithms with very different performance characteristics. The point is to teach algorithm analysis skills.

    Judging from the quality of code I encounter regularly, though, you're far from alone in failing to pick up that lesson.

  10. Sorting real objects by spaceyhackerlady · · Score: 3, 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