Given a tree, the task is to find the maximum in an only left node of the binary tree.
Input : 7 / \ 6 5 / \ / \ 4 3 2 1 Output : 6 Input : 1 / \ 2 3 / / \ 4 5 6 \ / \ 7 8 9 Output : 8
Traverse with inorder traversal and Apply the condition for the left node only and get maximum of left node.
Let’s try to understand with code.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Deepest left leaf node in a binary tree
- Change a Binary Tree so that every node stores sum of all nodes in left subtree
- Deepest left leaf node in a binary tree | iterative approach
- Complexity of different operations in Binary tree, Binary Search Tree and AVL tree
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Get Level of a node in a Binary Tree
- Get level of a node in binary tree | iterative approach
- Get last node of the binary tree following given pattern starting from X
- Print Left View of a Binary Tree
- Find sum of all left leaves in a given Binary Tree
- Convert left-right representation of a binary tree to down-right
- Iterative Method To Print Left View of a Binary Tree
- Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
- Print leaf nodes in binary tree from left to right using one stack
- Print all leaf nodes of a binary tree from right to left
- Connect all nodes to their Left Neighbors in a Binary Tree
- Sum of nodes in the left view of the given binary tree
- Print left and right leaf nodes separately in Binary Tree
- Print all leaf nodes of a Binary Tree from left to right
- Left-Right traversal of all the levels of Binary tree
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.