Similar questions 3 more →
Searching, Sorting & Selection

Your answer
Answer & solution
Official answer: A
Step 1: A central position in an array is not necessarily the median value. An adversarial ordering can place the smallest or largest current value at each selected pivot position. Step 2: Partitioning then leaves subproblems of sizes 0 and n−1 while doing Θ(n) work. The recurrence is T(n)=T(n−1)+Θ(n). Step 3: Summing the partition costs gives Θ(n+(n−1)+…+1)=Θ(n²). Therefore A is the tightest offered upper bound; O(n³) is true but weaker.