Practice free →
HomeGATE CSEcomputerscienceAlgorithms › Per the lecture, the worst-case lower bound on t…

Per the lecture, the worst-case lower bound on the number of comparisons made by any comparison-based sort on n elements is

A$\Omega(n \log n)$
B$\Omega(n)$
C$\Omega(n^2)$
D$\Omega(\log n)$
Answer & Solution
Correct answer: A. $\Omega(n \log n)$
Each pairwise comparison can split the space of possible orderings by at most a factor of 2, and there are n! possible orderings of n distinct elements. So any decision tree resolving them needs at least log_2(n!) ≈ n log n levels. Hence Ω(n log n) is the lower bound. Linear or sub-linear bounds are impossible without using non-comparison information.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions