Slashdot Mirror


Deep Algorithms?

Stridar writes "A paper presented in a recent article quotes Donald Knuth as saying the computer science has 500 deep algorithms. He mentions that Euclid's algorithm is one of the most important, and he seems to agree with the idea that CS will be mature when it has 1000 deep algorithms. What I would like to ask Slashdot is the following. What are the most important algorithms in CS? What is your favorite algorithm? And finally, what are the outstanding problems for which algorithms would be immediately placed in the "Top 1000" category." We had an older story where two scientists picked their top ten algorithms.

27 of 570 comments (clear)

  1. Bubble Sort? by cjpez · · Score: 2, Funny

    Does the Bubble Sort algorithm count as important?

    1. Re:Bubble Sort? by Odinson · · Score: 3, Funny
      Without bubble it would be impossible to obtain a bell curve in computer science classes.

      You're damn right it's important.

    2. Re:Bubble Sort? by adminispheroid · · Score: 2, Funny
      But in -any- case, bubble sort is VERY fast when the list is already sorted. And yes, it is very useful in practice.
      I recently invented an even faster sort for the case that the list is already sorted:
      #define lightning_sort(x) (x)
      Unfortunately, it only works in that one case.
  2. my favorite by Anonymous Coward · · Score: 0, Funny

    the failed first post algorithm

  3. My favorite algorithm by jwinter1 · · Score: 3, Funny

    Of course,

    Lather. Rinse. Repeat.

    --
    Anything you can do, I can do meta.
    1. Re:My favorite algorithm by seanadams.com · · Score: 5, Funny
      Lather. Rinse. Repeat.

      This fails the first requirement of an algorithm, according to Knuth:


      1 Finiteness. An algorithm must always terminate after a finite number of steps.
      - Knuth, TAOCP Vol 1, Page 4


      You know there's some guy still in the shower...
    2. Re:My favorite algorithm by blazin · · Score: 4, Funny

      I think at some point this algorithm should throw the outOfShampooException thus making it terminate after a finite number of iterations.

      Assuming everything shuts down correctly, the destructor or finalization method should be something along the lines of

      getOutofShower();
      self.dry(self);
      self.dress(s elf);

  4. Al-Gore-ithm by Anonymous Coward · · Score: 1, Funny

    My favorite Al-Gore-ithm was when he invented the Internet.

  5. An important algorithm I use everyday... by gpinzone · · Score: 5, Funny

    begin
    while alarm ringing
    cover head with blankets
    mprecate the onerous noisemaker softly
    consider turning the damn thing off
    if feeling remarkably hyperactive
    then
    lethargically slither out of blankets
    sinuously stretch out arm
    sigh
    bang it to kingdom come
    else
    go back to sleep sweet sleep
    endif
    if hear name being called
    then
    see who it is
    if kid brother/sister
    then
    ready
    aim
    fire
    watch baneful clock execute a parabolic trajectory
    in approximate direction of youngster
    if target intercepted
    then
    ignore howls for Amnesty International
    else
    swear a thousand maledictions
    endif
    else if father
    then
    get out of bed hyper-quickly
    if feeling watched
    then
    turn alarm off gently
    else
    kick alarm off gently
    endif
    else if mother
    then
    scan her for arms, especially those prohibited by
    Geneva Convention
    if result is affirmative
    then
    begin negotiations
    else
    pretend not to have seen her
    increase snoring intensity
    endif
    endif
    if feel something cold and wet being sloshed onto
    blankets
    then
    yell blue murder
    get out
    endif
    endwhile
    end

    Dinoj Surendran @ 1995 - no rights reserved

  6. Re:Algorithms? by dhogaza · · Score: 4, Funny

    Well, one world-famous mathematician was once quoted as haughtily saying that "Computer Science is just a trivial subset of Discrete Mathematics"...

  7. How about CSS? by JonWan · · Score: 4, Funny

    The "Content Scrambling System" it seems pretty Damn important to the MPAA and Congress. They even passed a law (DMCA) to support it..

  8. Shallow algorithms by csbruce · · Score: 2, Funny

    1) Patent the obvious
    2) Sue
    3) PROFIT!!

  9. Re:Are sorting algorithms "deep"? by a_n_d_e_r_s · · Score: 2, Funny

    I just live the bubble sort.

    It is also the best algorithm to use to
    sort a list....

    ...

    ... when there a few items in the list.

    --
    Just saying it like it are.
  10. Re:Off the top of my head by cpeterso · · Score: 3, Funny


    I like bubble sort.

  11. Lewis Caroll's day of the week algorithm by madmancarman · · Score: 2, Funny
    My personal favorite (and one I use all the time) is Lewis Caroll's algorithm that allows you to find the day of the week (Monday, Tuesday, etc.) for any given date (for example, August 15, 2001 would return a Wednesday). It's pretty useful with our school's attendance system, which is written in Perl and run on Apache.

    Personally, I find it interesting that this algorithm was developed by the same guy who wrote Alice's Adventures in Wonderland. A guy I teach with showed it to me a couple months ago, and I'm planning on using it in class soon to teach some programming concepts.

    First they ignore you, then they laugh at you, then they fight you, then you win. -- Gandhi

    --
    First they ignore you, then they laugh at you, then they fight you, then you win. -- Gandhi
  12. My favorite AlGoreithm by SecurityGuy · · Score: 5, Funny

    Gotta be inventing the Internet! How could you top that?

  13. Re:My favorite algorythm by walt-sjc · · Score: 3, Funny

    Just run it under Windows and it terminates eventually just fine! Therefore it's an algorithm!

    (I hated to lose the ability to mod, but I couldn't resist! :-) )

  14. My Personal Favorite by cube+farmer · · Score: 4, Funny

    Since I'm not formally trained as a computer scientist (I'm merely an information technology major, sorry), I can't offer much in the way of "deep" algorithms to this list.

    However, I can poke fun...

    My personal favorite algorithm is:

    1. Launch Web Site
    2. ??????
    3. Profit!

    (Ducks)

    --

    MacOS, Windows, BeOS, GNOME, KDE: they're all just Xerox copies

  15. The Illegal Infinite Knowledge Algorithm by Anonymous Coward · · Score: 1, Funny


    The following must be *the* most important algorithm known. ;-) It --- if run sufficiently long enough, say, oh, a few forevers --- generates a representation of all possible knowledge that can be represented:

    (let ((y 0))
    (define knowitall
    (lambda (x)
    (begin
    (if (= x 0) (write-char #\.))
    (write x)
    (knowitall (+ 1 x)))))
    (knowitall y))

    Why? This algorithm generates (a decimal representation of) Champernowne's Constant, which is a / the (only known?) string that contains within it every possible substring of arbitrary length drawn from the same alphabet of characters. Warning: this algorithm is probably illegal, because it contains within it / will eventually generate DeCSS, the complete source code to every version of Microsoft Windows ever, the complete collection of all Mariah Carey's songs in MP3 format, the complete set of all the documents that Anderson shredded on behalf of Enron, the exact GPS coordinates of Osama Bin Laden at every moment for the rest of his life, George Bush's complete DNA sequence, etc. Enjoy! :-)

  16. Another Exception by restless_ne'erdowell · · Score: 2, Funny

    Don't forget about the outOfHotWaterException. If not caught properly, it results in a blue screen of freezing.

  17. Re: 1000 is too naive by aralin · · Score: 3, Funny

    Maybe, if you'd read what prof. Knuth said, you'd know he mentioned the 1000 algorithm as a START. About the number of algorithms the CS should have to START to be recognized as a relevant science.

    --
    If programs would be read like poetry, most programmers would be Vogons.
  18. Heh...heh by waldoj · · Score: 3, Funny

    You know there's some guy still in the shower...

    OK, so it's 1987, and I'm 8 years old. My family has just gotten our first computer, an IBM PS/2 Model 30 -- one of the systems with BASIC in ROM. I''ve taken up writing in BASIC, and do so in most of my free time. Which, as an eight-year-old, is a considerably amount of time. I'd taught myself all about Boolean logic, loops, etc., etc.

    This is the part that I don't remember, probably because it's been obliterated by my family repeating the story so often. I've been in the shower for something like half an hour when my mother starts knocking on the door, wanting to know if I'm OK. I insist that I'm fine. This process is repeated for a while until they finally force me to get out, no doubt prune-like by this time. My mother asks me what in the world I've been doing in the shower for so long.

    I point to the directions on the back of the bottle and say, simply, "Wash. Rinse. Repeat."

    -Waldo Jaquith

  19. Elevator Awareness Algorithm by Anonymous+Squonk · · Score: 3, Funny
    If x=2 Then y=2 Else y=1

    Where x is the number of people in the elevator and y is the number of people who know for sure who farted.

  20. Re:What about the by t · · Score: 2, Funny

    CowboyNeal could be exp(-ix) which would then make him purely imaginary...

  21. how about this one? by Anonymous Coward · · Score: 1, Funny

    1-click shopping

  22. Re: "throw the outOfShampooException" by Ocelot+Wreak · · Score: 2, Funny
    And you could also throw an exception on sham poo and instantiate some REAL poo!

    -wjc.

    --
    "I figure you're here 'cause you need some whacko who's willing to stick his finger in the fan. So who are we helping?