Lecture 6
Lecture 6
Lecture 6
In Postorder traversal first visit left sub tree, then right sub tree and then the
root element.
Procedure:-
Step 1: Visit left sub tree in postorder
Step 2: Visit right sub tree in postorder
Step 3: Visit root node
Postorder Tree Traversal
Binary Search Tree
A binary search tree (BST) or "ordered binary tree" is a
tree in which each node contains a key that satisfies
following conditions:
1. All keys are distinct.’
2. all elements in its left subtree are less to the node
(<), and all the elements in its right subtree are
greater than the node (>).
Binary search tree
Binary search tree property
For every node X
All the keys in its left
subtree are smaller than
the key value in X
All the keys in its right
subtree are larger than the
key value in X
Binary Search Trees
Binary Tree