Binary Search Tree
[7, 5, 1, 8, 3, 6, 0, 9, 4, 2]
~Question: Write Binary Search Tree stages of the array
~Solution:
Binary Search Tree is a node-based binary tree data structure which has the following properties:
1)The left subtree of a node contains only nodes with keys lesser than the node’s key.
2)The right subtree of a node contains only nodes with keys greater than the node’s key.
3)The left and right subtree each must also be a binary search tree.
1.step:
2.step:
3.step:
4.step:
5.step:
6.step:
7.step:
8.step:
9.step: