# Types of Binary Trees Introduction. Types of Binary Trees There are several types of binary trees possible each with its own properties. Few important.

## Presentation on theme: "Types of Binary Trees Introduction. Types of Binary Trees There are several types of binary trees possible each with its own properties. Few important."— Presentation transcript:

Types of Binary Trees Introduction

Types of Binary Trees There are several types of binary trees possible each with its own properties. Few important and frequently used trees are listed as below: 1. Binary search tree 2. Expression tree 3. Heap tree 4. Threaded Binary tree

Types of Binary Trees 5. Height balanced tree(AVL tree) 6. 2-3 Trees 7. Weight Balanced tree 8. m-ary Trees tree 9. Trie Structures tree 10. B/B+ tree

Binary Search Tree A binary search tree T is termed as binary Search tree (or binary sorted tree) if each node N of T satisfies the following property: The value of the node in the left childe or Left sub tree is less than the value of the root. The value of the node in the right child or right sub tree is more than or equal to the value of the root. All the sub trees of the left & right children observe above two rules.

Binary Search Tree Exampel-1

Binary Search Tree Example-2

Basic Operation on Binary Search Tree Inserting any data into it Deletion any data from it Searching for a data Traversing the data

What is different between Tree, Binary tree & Binary Search tree? A tree is a data structure that only allows one parent but multiple children. A Binary Search tree is a specific case of a tree. First, it is a binary tree, meaning that a node can at most have two children. Here, sorting not imported. And it is a binary search tree meaning that the left child of a value is less than the parent value while the right child value is greater than the parent value.

Traversal of a Binary Search Tree There are: Preorder traversal (PLR) Inorder traversal(LPR) Postorder traversal(LRP)

Traversal of a Binary Search Tree

Sequence of the previous example: Preorder traversal (PLR) 16,10,5,14,25,18,90 Inorder traversal(LPR) 5,10,14,16,18,25,90 Postorder traversal(LRP) 5,14,10,18,90,25,16

Traversal of a Binary Search Tree

Sequence of the previous example: Preorder traversal (PLR) P,H,A,D,K,M,S,R,T,W Inorder traversal(LPR) A,D,H,K,M,P,R,T,S,W Postorder traversal(LRP) D,A,M,K,H,T,R,W,S,P

Download ppt "Types of Binary Trees Introduction. Types of Binary Trees There are several types of binary trees possible each with its own properties. Few important."

Similar presentations