Ask Question
14 September, 19:18

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.

+4
Answers (1)
  1. 14 September, 22:05
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers