Discussion
Suppose that the splits at every level of quicksort are in the proportion \((1 - \alpha)\) to \(\alpha\), where \(0 \lt \alpha \le \frac{1}{2}\) is a constant. The minimum depth of a leaf in the recursion tree is approximately given by
Answer: C
The minimum depth is \(-\lg n / \lg \alpha\).
The shallowest path always follows the smaller part \(\alpha\) of each split. After \(k\) levels the subproblem has size \(\alpha^{k} n\) and the leaf is reached when \(\alpha^{k} n = 1\), giving \[ k = -\frac{\lg n}{\lg \alpha}. \]
The expression with \(\lg(1 - \alpha)\) is the maximum depth, which follows the larger part, and the expressions with \(\lg n\) in the denominator are not depths.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development