Ask Question
15 July, 16:21

C+ + write a simple pseudo code to insert a new node to Binary Search Tree.

+2
Answers (1)
  1. 15 July, 18:30
    0
    if root node is NULL then return new node with data equal mentioned. If the data data root->left=recursive call on left subtree. else if data >root->data root->right = recursive call on right subtree. 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.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “C+ + write a simple pseudo code to insert a new node to Binary Search Tree. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers