2. BINARY TREE
Each parent node has atmost two child nodes.
It has parent node and 2 leaf nodes
This is called a binary tree.
Eg:
2
7 5
3 6 3 8
4. BINARY SEARCH TREE ( CONT..)
Left child values should be less than the parent
node or Root node.
Right child values should be greater than Root
Node.
This is called Binary search tree.
5. For the purpose of searching we have a different
types of searches.
Linear search
Binary search
Binary tree data structure.
6. BINARY TREE DATA STRUCTURE
Binary tree is mainly used for searching purpose
also and it is very easy to identify the elements.
For searching an element in binary tree,the
maximum time is taken, when the element is
present in a leaf.
The height of the binary tree is log n.
In order to rectify the cost of search we are using
optimal binary search tree.
7. OPTIMAL BINARY SEARCH TREE
The arrangement of elements in the form of a
binary data structure such that the cost of searching
the elements is minimum.
This is called optimal binary search tree.
To reduce the cost of searching we use optimal
binary search tree.
The word “optimal” means best so , to search an
element we use the best way that is optimal binary
search tree.
8. Eg: Consider a set of elements
10,20,30
Cost of searching is 1+2+3=6 ( maximum)
1
2
3
10
20
30