Binary tree question -
Node has numeric data (int)
The function takes depth as argument and sum all the value
of the node of the depth.
For instance,
(0) depth 0
/ \
10 20 depth 1
/ \ / \
40 50 60 70 depth 2
so if you pass get_sum(2), you would return 220 which is
40+50+60+70 (sum of depth2)
write the function.
No Answer is Posted For this Question
Be the First to Post Answer
What does the expression exception::__tostring means?
What websites use php?
What is the difference between pop3 IMAP and MAPI?
Is python better than php?
how to get the value in script values
What is inheritance in php? How many types of inheritance supports php?
What are the main error types in php and how do they differ?
How many ways we can give the output to a browser?
What is a closure in php?
What does explode do in php?
What is htaccess? Why do we use this and where?
Tell me how can we determine whether a variable is set?