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

Which geographical theme is used to understand geography when using a GPS device to get to the beach? A. Location B.Movement C. Region D. Place
65(x-5)+x=180 please help. Leave description please! Thank you!
40 PTS!!! I WILL GIVE BRAINLIEST IF YOU DO THIS!!! My book is The Yearling, by Marjorie Kinnman Rawlings Writ
Answer this question.
In the following number, which place value does the 3 hold? 993,140 hundreds thousands ten thousands hundred thousands
joe forgot his homework at home.he runs home to get it.he accelerates from 0 to 15m/s in 5 seconds,runs at 15m/s for 50 seconds,and then slows down from 15m/s t
An element's atomic number is 39. How many protons would an atom of this element have?
Professor quantum has two coins which total 35 cents. since one of the coins is not a dime, what are the two coins
Read the following scenario. In a workplace meeting, the topic under discussion is a recently missed deadline and how deadlines can be met in the future. Which
What greatest 0.85 or 85/100