logoalt Hacker News

bee_rideryesterday at 11:23 PM0 repliesview on HN

Just look at the little video on Wikipedia, it is an absolute mess of elements being thrown around. Chaos.

Real answer: I tutored beginner programming students for a bit and I guess I just thought quicksort didn’t fit in very well.

Mergesort is an elegant and straightforward example of recursion. Heapsort—you can make a priority queue and then if you plop a heap in there, that’s heapsort. I like the story.

With quicksort, it isn’t that complicated or anything but it doesn’t feel like it embodies an idea in the way the other two do. And it is annoying that the real big-O cost of the popular sorting algorithm is n^2, and the bad case is really obvious. I guess there’s value to getting over the hump of “well heuristics are a thing and big-O doesn’t tell you everything” but I still don’t like it.