Tuesday, 12 May 2015

Q42,paper 3, J12. Which one of the following binary search tree is optimal, if probabilities of successful search and unsuccessful search are same ?


Explanation.
All of them equal probability of search.Probability of {a=.33,b=.33,c=.33 }
In tree given in A option.cost is (.33+.33*2+.33*3.)
Similarly tree given in option B is (.33+.33*2+.33*3.)
Similarly tree given in option C is (.33+.33*2+.33*3.)
Cost in given option D is(.33+.33*2+.33*2.) hence Option D cost is minimum.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.