As I was stumbling across the dark corners of the internet I came across this following article: Sorting Algorithms: Quite Boring Until You Add Sound Effects which referenced the following video:
Now, I wanted to share this video not only because I find it geekishly cool, but because I remembered an interesting story.
When I took classes as an undergrad, I always tried to find the time to speak with professors after class since they had the most interesting stories to tell. This one in particular was quite surprising.
So my algorithms professor starts by discussing how surprised he is with what graduate students can manage to pull of.
For example, he would interview a handful of talented students and pick the best one based on their interested and qualities for a certain project. He never had a doubt that these students couldn’t get the job done. He just never realized what some of these students would be capable of in order to get their programs to run successfully.
When he had the opportunity to look through the students code in order to see if they were using efficient algorithms throughout their design. To his dismay, he realized a particular sorting algorithm was famous amongst graduate students. Would you guess something as efficient as merge sort or quick sort? Well, no.
So what was it?
It had to be bubble sort (complexity: [pmath]n^2[/pmath]). Apparently graduate students as smart as they may be, can either forget how to program more efficient algorithms (such as [pmath]nlogn[/pmath] algorithms) or sometimes rather take a shortcut or two.
So the message from this professor? Please don’t forget your elementary programming skills and try optimizing whenever you can. Sure, the program is correct but it can be more efficient.
Little decisions like these might not have a huge impact but when the code for such a library starts scaling into the tens of thousands of line of code, that decision on a simple algorithm could make a significant difference.
So the question is, would you rather have your program sound like a bubble or a merge sort?
