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

The sum of twice a number and 9 is-25
What is the value of x in the figure below? I’m this diagram
find csc theta and sin theta if tan theta = 7/4 and sin theta less than 0
In which of the following triangles is cos B = 0.8? A B C D
A student wishes to find the average thickness . she obtain the following measurements mass of sheet = 60.7g lenght of sheet = 50.0cm width of sheet = 30.0 cm
Need the answer quick
Adjectives in Spanish agree with the noun they modify in number and gender.
From the diagram below, of the distance between the tree and point B is 125 meters, and the angle of depression from the top of the tree to point B is 46 degree
find the value of x
Imagery is when the author uses words to create "mental images" for the reader. True False