Open In App

Algorithms | Sorting | Question 17

Like Article
Like
Save
Share
Report

In quick sort, for sorting n elements, the (n/4)th smallest element is selected as a pivot using an O(n) time algorithm. What is the worst-case time complexity of the quick sort?

(A) \\theta (n)

(B) \\theta (n*log(n))

(C) \\theta (n2)

(D) \\theta (n2 log n)

(A)

A

(B)

B

(C)

C

(D)

D



Answer: (B)

Explanation:

The recursion expression becomes: T(n) = T(n/4) + T(3n/4) + cn After solving the above recursion, we get \\theta (n*log(n)).



Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads