Given a Binary Tree, find the maximum sum in a binary tree by adding the parent with its children. Exactly three Node needs to be added. If the tree does not have a node with both of its children as not NULL, return 0.
We simply traverse the tree and find the Node that has the maximum sum. We need to take care of the leaves.
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.
- Convert an arbitrary Binary Tree to a tree that holds Children Sum Property
- Node having maximum sum of immediate children and itself in n-ary tree
- Check for Children Sum Property in a Binary Tree
- Count of nodes in a Binary tree with immediate children as its factors
- Count of nodes in a Binary Tree whose immediate children are co-prime
- Count nodes with two children at level L in a Binary Tree
- Iterative approach to check for children sum property in a Binary Tree
- Find the parent of a node in the given binary tree
- Sum of all parent-child differences in a Binary Tree
- Sum of all the child nodes with even parent values in a Binary Tree
- Construct Binary Tree from given Parent Array representation
- Find right sibling of a binary tree with parent pointers
- Find parent of given node in a Binary Tree with given postorder traversal
- Lowest Common Ancestor in a Binary Tree | Set 2 (Using Parent Pointer)
- Find Height of Binary Tree represented by Parent array
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Construct Binary Tree from given Parent Array representation | Iterative Approach
- Construct a Maximum Binary Tree from two given Binary Trees
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Maximum spiral sum in Binary Tree