Answer :

Answer:

  1. if root node is NULL then return new node with data equal mentioned.
  2. If the data <root->data
  3. root->left=recursive call on left subtree.
  4. else if data >root->data
  5. root->right =recursive call on right subtree.
  6. At last return root.

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.

Other Questions