Describe Binary Search Tree (BST)? Make a BST for the given sequence of numbers.
45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48
Traverse the obtained tree in Preorder, Inorder and postorder.
A binary search tree B is a binary tree whose each node satisfies the following conditions:
1. The value obtained of the left-subtree of 'x' is less than the value at 'x'
2. The value obtained of the right-subtree of 'x' is greater than value at 'x'
3. The left-subtree and right-subtree of the binary search tree are again binary search tree.
Preorder:-
23, 36, 39, 41, 45, 48, 56, 69, 76, 89, 98, 115
Inorder:-
45, 36, 23, 39, 41, 76, 56, 48, 69, 89, 115, 98
Postorder:-
23, 41, 39, 36, 48, 69, 56, 98, 115, 89, 76