Answer:
- if root node is NULL then return new node with data equal mentioned.
- If the data <root->data
- root->left=recursive call on left subtree.
- else if data >root->data
- root->right =recursive call on right subtree.
- At last return root.
Step-by-step explanation:
Node is always inserted at the at the leaf node.We will search the data in the tree if we hit a the leaf node the new node is inserted as the child of the leaf node.