1. Optimal Binary Search Tree
Dr. P. Subathra
Prof/ IT
KAMARAJ College of Engg. & Tech
(AUTONOMOUS)
Madurai
Tamil Nadu
India
2. • If probabilities of searching for elements of a set are
known—e.g., from accumulated data about past
searches—it is natural to pose a question about an
optimal binary search tree for which the average
number of comparisons in a search is the smallest
possible.
• we limit our discussion to minimizing the average
number of comparisons in a successful search.
• The method can be extended to include unsuccessful
searches as well.
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
2
3. • The total number of binary search trees with n
keys is equal to the nth Catalan number
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
3
4. Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
4
5. OBST CREATION
(j-i)=0
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0
1
2
3
4
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
5