Sunday, December 7, 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

1 COMMENT

Most Popular

Dominic
32427 POSTS0 COMMENTS
Milvus
103 POSTS0 COMMENTS
Nango Kala
6803 POSTS0 COMMENTS
Nicole Veronica
11944 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12014 POSTS0 COMMENTS
Shaida Kate Naidoo
6934 POSTS0 COMMENTS
Ted Musemwa
7188 POSTS0 COMMENTS
Thapelo Manthata
6882 POSTS0 COMMENTS
Umr Jansen
6867 POSTS0 COMMENTS