glendaward4164 glendaward4164
  • 21-08-2019
  • Computers and Technology
contestada

Write a short recursive method that will find and return the leftmost node of a binary tree. Presume the method will initially be called with the root node as its input argument.

Respuesta :

ExieFansler ExieFansler
  • 28-08-2019

Answer:

Node * leftmost(Node * root)

{

 if(root==NULL)

return NULL;

return leftmost(root->left);

}

Explanation:

This is the function to return the leftmost node of the Binary tree in C++.Return type of the function is Node.If root is NULL then we are returning NULL because there is no tree.Now we have to make a recursive call on root->left.

Answer Link

Otras preguntas

What is the surface area of this rectangular prism iready
If you don’t know then don’t say anything.
List four function of office and explain them​
find the height of a cylinder whose volume is 1.54 m³ and diameter of base is 140 cm​
In out of the dust what does billie jo see negatively
Simplify. √20 ⋅ √3 ⋅ √18 √610 √510 √530 √630
the bird of the golden land summary and about the main characters in english​
The perimeter of an equilateral triangle is 21.33 centimeters. The equation 3s = 21.33 can be used to find s, the length of each side of the triangle. How many
Use the equation p = 8d to solve the following situation. To build more muscle, Austen does 8 push-ups each day. Let d represent the number of days and p repres
What is 113123 times 43dividede by 13 times 34 plus 23232 (434*323 divided by 43)