Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The root node should be of value 16 after compiling the code #45

Open
Prathamesh-01 opened this issue Aug 2, 2019 · 2 comments
Open

Comments

@Prathamesh-01
Copy link

If we traverse through the tree from down, the child of root node will contain 12 and 4, so the summation of both is 16 but you got 20

@ghost
Copy link

ghost commented Aug 2, 2019 via email

@himanigupta2003
Copy link

himanigupta2003 commented Aug 27, 2021

noooo....thats completely right
see
/*
10
/
-2 6
/ \ / \
8 -4 7 5

*/

/*

 20(4-2+12+6)
       /      \
4(8-4)      12(7+5)
   /   \      /  \ 
 0      0    0    0

*/

now you can relate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants