Friday, September 5, 2025
HomeData Modelling & AIAlgorithms | Sorting | Question 17

Algorithms | Sorting | Question 17

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32269 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6638 POSTS0 COMMENTS
Nicole Veronica
11802 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11866 POSTS0 COMMENTS
Shaida Kate Naidoo
6752 POSTS0 COMMENTS
Ted Musemwa
7027 POSTS0 COMMENTS
Thapelo Manthata
6704 POSTS0 COMMENTS
Umr Jansen
6721 POSTS0 COMMENTS