What is the time complexity of the Quick Sort algorithm in the average case ?
Tripura Public Service Commission - 2026,
Answer: B
Quick sort's average case is O(n log n).
Each partition step does linear work. With reasonably balanced splits the recursion is about log n levels deep, giving n log n in total, and averaged over random inputs or random pivots the expected number of comparisons is about 1.39 n log2 n.
\(O(n^{2})\) is quick sort's worst case, when the pivot is always the smallest or largest element, for example on sorted input with a first-element pivot. O(n) is too fast for any comparison sort, and O(log n) is the depth of the recursion, not the total work.
Please log in or register to report this question.