buggautt9171 buggautt9171
  • 24-08-2019
  • Computers and Technology
contestada

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

Respuesta :

ExieFansler ExieFansler
  • 27-08-2019

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.

Answer Link

Otras preguntas

Okay please help find the value of x, measure of angle DMC, measure angle of MAD, measure angle of ADM, measure angle of ADC
write the inequality for each one​
Current studies on frogs and wildlife indicate that hormonally active agents (HAAs) are __________. a. found in insecticides and should be removed b. found in r
7.167 times 10 to the power of 6
Which sentence contains an error in word usage? Help me please!!
Negative numbers: addition and subtraction: Qui Which of the following expressions are 4 8 4 9 equivalent to +- ? 7 9 7 8 Choose 2 answers: 4 8 - + 9 + TIN 8 4
The traits of freckles is dominant and represented by a no freckles is recessive and represented by a
Pls help quick number 2 and 3 pls!
Do you think the Japanese army's actions in Manchuria were good or bad for Japan? Explain and support your answer.
Can someone help me with this please