Question: In Binary Search Tree, the fun method. What would happen if the line node.left = insert ( node . left, key ) ; is replaced
In Binary Search Tree, the fun method. What would happen if the line node.left insertnodeleft, key; is
replaced with node.left insertnoderight, key;
Node fun Node node, int key
if node null
return new Node d: key;
if key node.key
node.right fun node: node.right, key;
else if key node.key
node.left fun node: node.left, key;
return node;
A The BST would not be configured correct.
B The BST would be reversed in order.
C The BST would become full BST
D The BST would become AVL Tree.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
