Data Structures | Binary Search Trees | Question 12
Consider the following Binary Search Tree
10
/ \
5 20
/ / \
4 15 30
/
11
If we randomly search one of the keys present in above BST, what would be the expected number of comparisons?
(A) 2.75
(B) 2.25
(C) 2.57
(D) 3.25
Answer: (C)
Explanation: Expected number of comparisons = (1*1 + 2*2 + 3*3 + 4*1)/7 = 18/7 = 2.57
Quiz of this Question
Recommended Posts:
- Data Structures | Binary Search Trees | Question 12
- Data Structures | Binary Search Trees | Question 1
- Data Structures | Binary Search Trees | Question 8
- Data Structures | Binary Search Trees | Question 2
- Data Structures | Binary Search Trees | Question 5
- Data Structures | Binary Search Trees | Question 4
- Data Structures | Binary Search Trees | Question 12
- Data Structures | Binary Search Trees | Question 3
- Data Structures | Binary Search Trees | Question 10
- Data Structures | Binary Search Trees | Question 7
- Data Structures | Binary Search Trees | Question 6
- Data Structures | Balanced Binary Search Trees | Question 13
- Data Structures | Balanced Binary Search Trees | Question 12
- Data Structures | Balanced Binary Search Trees | Question 7
- Data Structures | Balanced Binary Search Trees | Question 13



