Hacker News new | past | comments | ask | show | jobs | submit login
Barack Obama knows his sort algorithms... jump to 6:40 in this video (youtube.com)
15 points by tlrobinson on Dec 3, 2007 | hide | past | favorite | 14 comments



How appropriate that a topic of sorting algorithms comes up in a discussion about politics. Both spheres of discourse contain some of the most useless debate about solved problems.


A question to any Americans:

What are your thoughts on Obama? From an outsiders perspective, he seems like the ideal candidate. He is charismatic, intelligent, and quick thinking. He also seems to have the 'right' approach on every subject he speaks about. How is someone like this not going to win by landslide?

On a side note, how are people like Rudy even remotely considered a candidate?


Please, let's not start talking about politics here...


Sorry, didn't realize this was against the rules...

I was just talking about a subject related to the video posted.


> How is someone like this not going to win by landslide? ... > On a side note, how are people like Rudy even remotely considered a candidate?

Uneducated voters. A lot of people think Barack Hussein Obama is a Muslim, and that Rudy is a terrorist fighting 9/11 hero.


So, what's the right answer, guys? Quicksort? Radix?


Any of the non-comparison sorts (radix, bucket, etc) would be good since he specified the elements are integers.


Not necessarily. The problem's rather underconstrained, but under reasonable asusumptions about memory allocation, you might actually get better performance from a quick sort, since the algorithm works with a lot of locality. Although you'd be right in a strict theoretical sense, sure.


When in doubt, use quantum bogosort. http://en.wikipedia.org/wiki/Bogosort#Quantum_Bogosort


"There is also no telling how much processing power and/or memory would be required to destroy a universe."

With my quad-core all I could manage was a thunderstorm in Denmark.


I prefer to use my cycles for good rather than evil. For example, my 8-core system is keeping me cozily warm throughout the presently-occuring snowstorm.


I don't think you can recommend Quicksort unless you know something about the distribution of the elements to be sorted, or am I mistaken. After all, Quicksort can be very slow under certain conditions.


Quicksort's worst case involves bad pivot picking. The randomized version pretty much makes that a non-issue unless you're incredibly unlucky. Even still, with median-of-medians you can guarantee a deterministic worst case of nlog(n), so that's not true.


You can keep track of the performance of Quicksort then fallback to Insertion Sort if Quicksort is sucking. This is how std::sort() works in most C++ implementations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: