Hacker News new | ask | show | jobs
by cinnamonheart 2425 days ago
The logic of bubble sort is so simple that just the description is enough for an implementation. It's a common interview question for the same reason Fizzbuzz is used -- any programmer worth their salt should be able to just write it down.

Insertion and selection sort are also O(N^2), but sorts like merge and quick will use them to sort small sublists in their recursive cases because they are fast when input is small enough.

1 comments

I see. I would hope one would give a description of what bubble sort is during the question.

It's definitely easy to implement, it just had me worried because I had never heard of it!