Ask Question
28 June, 00:48

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

+3
Answers (1)
  1. 28 June, 01:45
    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?
Find an answer to your question ✅ “C+ + write a simple pseudo code to insert a new node to Binary Search Tree. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers