Open In App

Data Structures | Binary Search Trees | Question 12

Like Article
Like
Save
Share
Report

Consider the following Binary Search Tree
 

 

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
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads