Be the first user to complete this post
|
Add to List |
138. Find the Maximum Value in a Binary Tree
Objective: – Given a binary tree , Find the max element in it.
Example:

Approach:
- Use Recursion.
- Max will the Max(root, max element in the left subtree, max element in right subtree)
- Recursively solve for the max element in the left subtree and right subtree.
Output:
Max element in Binary Tree: 35