I’m not able to imagine/understand line 120 - 124. I’m not getting why we are doing this and will not able to implement the same myself till I’m not clear with the exact reason.
Doubt in max sum path from any node to node
Hello @gambhirrahul0 we are here calculating max sum of current node we need 4 things
- left branch sum
- right branch sum
- max sum of left subtree
- max sum of right subtree
so we have to call left and right
each of them will return two things => branch sum and max sum
Branch sum is sum of path starting from root of left or right subtree to the any node is that subtree
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.