Start learning →

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.
Practise this question with Quill — GATE CSE →

Keep practising Algorithms

Browse all Algorithms questions for GATE CSE, or explore more Computer Science topics.

Start a Algorithms lesson →
Related questions