Reputation: 435
What is the difference between insertion in Binary Search Tree(BST) and in Binary Tree(BT)? I know in BST, you compare the value of the new node with root, if smaller, you added to its left, if bigger you add it to the right of the root. Is it the same procedure for BT? If not, what procedure does it follow for insertion and removal?
Upvotes: 1
Views: 881
Reputation: 274
Looks like you have misunderstanding of BT and BST defenitions. First you need to know difference between BT and BST.
Answering your question:
Upvotes: 1
Reputation: 22761
You are not restricted to have children <= or >= to the parent node depending on left/right.
Just put them anywhere as long as each node has at most 2 children.
Upvotes: 0