Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Data Structures | Balanced Binary Search Trees | Question 2

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The worst case running time to search for an element in a balanced in a binary search tree with n2^n elements is 
(A) \\Theta(n log n)
(B) \\Theta (n2^n)
(C) \\Theta (n)
(D) \\Theta (log n)

(A)

A

(B)

B

(C)

C

(D)

D


Answer: (C)

Explanation:

Time taken to search an element is \\Theta (h) where h is the height of Binary Search Tree (BST). The growth of height of a balanced BST is logarithmic in terms of number of nodes. So the worst case time to search an element would be \\Theta (Log(n*2^n)) which is \\Theta (Log(n) + Log(2^n)) Which is \\Theta (Log(n) + n) which can be written as \\Theta (n) .


Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads
Related Tutorials