Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 38
    I like asking this question in interviews: "When is quick-sort better than bubble-sort?" The answer to the question provides insight into the practical application of complexity theory and not just plain black and white statements such as O(1) is better than O(n) or O(k) is equivalent to O(logn) etc.... Commented Feb 4, 2010 at 6:30
  • 70
    @Beh, I think you meant "when is bubble-sort better than quick-sort" :P Commented Feb 4, 2010 at 16:17
  • 3
    Would a smart pointer be a trivial key? Commented Dec 9, 2013 at 10:42
  • 8
    @Matthieu N. In your place, using this kind of question which will hardly ever be useful and which unnecessarily embarrasses a lot of candidates, I would rather be embarrassed :/ Commented Aug 17, 2021 at 12:47
  • 12
    FWIW, in response to @user6547518, it does seem like a rather stupid interview question. If I had any need to implement a sorting algorithm from scratch, I'd consider the particular needs/constraints in my situation, and revisit the descriptions of sorting algorithms before implementing it. 35 years ago, before the internet and standard implementations in the languages I use, I probably knew the difference between those two, but I no longer feel the need to retain information like that. Commented Oct 26, 2022 at 12:05