GATE 2012 CS (CS1) – Question 15
Find the worst-case search time in a balanced BST with $n2^n$ elements.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $\Theta(n)$
Explanation
A balanced BST search takes Θ(log N) for N elements. Here $\log(n2^n)=\log n+n\log2=\Theta(n)$. Thus option C. The exponential element count still produces only linear-in-n tree height.
More Asymptotic Analysis and Time/Space Complexity questions
- GATE 2012 CS (CS1) Q28
- GATE 2013 CS (CS1) Q40
- GATE 2013 CS (CS1) Q41
- GATE 2011 CS (CS1) Q47
- GATE 2010 CS (CS1) Q22
- GATE 2015 CS (CS2) Q16
All Asymptotic Analysis and Time/Space Complexity questions →