Question 36Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Suppose that the splits at every level of quicksort are in the proportion (1 − α) to α, where 0 < α ≤ 1/2 is a constant. The minimum depth of a leaf in the…

Suppose that the splits at every level of quicksort are in the proportion (1 − α) to α, where 0 < α ≤ 1/2 is a constant. The minimum depth of a leaf in the recursion tree is approximately given by
  1. A−lg n / lg(1 − α)
  2. B−lg(1 − α) / lg n
  3. C−lg n / lg α
  4. D−lg α / lg n
Show answerHide answer

Correct answer: (C) −lg n / lg α

Explanation

In Quicksort, the depth of a leaf depends on how the input size reduces at each level. If the split is always in the ratio (1 − α) to α, the minimum depth corresponds to the path where the recursion always follows the smaller partition, i.e. of size αn. At each level the size becomes n, αn, α²n, α³n, … We stop when the size becomes 1: αᵏn = 1 ⇒ k log α + log n = 0 ⇒ k = −lg n / lg α. Hence the answer is (c).

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 36 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.