Practice free →
HomeGATE CSEcomputerscienceAlgorithms › Standard quick sort with the first element as pi…

Standard quick sort with the first element as pivot has worst case

AΘ(n log n)
BΘ(log n)
CΘ(n²)
DΘ(n)
Answer & Solution
Correct answer: C. Θ(n²)
When the partition always produces a split of size 1 and n−1 (e.g., the input is already sorted and we pivot on the first element), the recurrence becomes T(n) = T(n−1) + Θ(n) which solves to Θ(n²). This is bubble-sort territory. Best case (balanced splits) is Θ(n log n); the other options are too low.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions