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
- Check for Children Sum Property in a Binary Tree
- Iterative approach to check for children sum property in a Binary Tree
- Node having maximum sum of immediate children and itself in n-ary 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
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Count nodes with two children at level L 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
- Find root of the tree where children id sum for every node is given
- Find Height of Binary Tree represented by Parent array
- Construct Binary Tree from given Parent Array representation
- Lowest Common Ancestor in a Binary Tree | Set 2 (Using Parent Pointer)
- Find right sibling of a binary tree with parent pointers
- Construct Binary Tree from given Parent Array representation | Iterative Approach
- Find parent of given node in a Binary Tree with given postorder traversal
- Find the parent of a node in the given binary tree
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- General Tree (Each node can have arbitrary number of children) Level Order Traversal
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.