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

1 Select the correct answer. The edges of a cube are 5 centimeters each and the diagonal of a face is approximately 7 centimeters. What is the approximate area
How many orbitals does Nickel have? A:10 B:5 C:4 D:3
What are the relation between surface area and heat absorption.​
finds out that there are open questions regarding one of the user stories. Alex - the Scrum Product Owner - is quite busy and not available for a meeting to ans
What is the midpoint of lq? point M point N point P point Q
SOMONE PLEASE HELP!!!
The graph shows the size of two populations of the same species over time. question text "The graph shows the size of two populations of the same species over t
How did the settlers in the mid atlantic use native foods to prepare the dishes of their homelands?
Name and symbol of the ion formed when an iron loses three electrons
what is the answer to 8/? + 5/? = 7/?