Here is a lower bound proof for the comparison-based sorting problem:

  • Any comparison-based sorting algorithm can be considered to work by putting elements into their final positions one by one (Take the last time one element is put into its final position.).
  • To put the element $e$ which is the $i$-th one being put into its final position, the algorithms should know the relative ordering between $e$ and the first $n-1$ elements that are already put into their final positions. This costs at least $\Omega(\lg i)$ comparisons.
  • Therefore, the total number of comparisons is at least $$\sum_{i=1}^{n-1} \lg i = \Omega(n \lg n).$$

Is this a reasonable proof? (I am quite confused about the second step.) If so, how to formalize it more rigorously?

  • 1
    $\begingroup$ Doesn't seem rigorous at all. Essentially, you're saying that binary selection sort requires $\Omega(n\log n)$ comparisons, so every comparison-based sorting algorithm must. $\endgroup$ Commented Mar 29, 2018 at 18:53
  • $\begingroup$ By the way, I assume you mean "the first $i-1$ elements" in bullet 2. $\endgroup$ Commented Mar 29, 2018 at 18:53

1 Answer 1


No, I don't think it's a reasonable proof. This makes claims without justification. For instance, the second bullet says that the only way to put an element into its final position is (the algorithm must know something..). How do you know that is correct? How would you prove that? What does it even mean for an algorithm to know something? Why does knowing that cost at least $\Omega(\lg i)$ comparisons? All of that seems a bit unclear to me, so I don't find it a persuasive proof.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.