Ask Question
9 May, 12:20

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.

+2
Answers (1)
  1. 9 May, 12:30
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a short recursive method that will find and return the leftmost node of a binary tree. Presume the method will initially be called ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers