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
How to Define a Constant in PHP? Is $ symbol necessary?
Is array empty php?
How failures in execution are handled with include() and require() functions?
How to parse configuration file in php?
What is the difference between $message and $$message?
Whats the difference between include() and require()?
How do you use bcrypt for hashing passwords in php?
What are the 3 scope levels available in php and how would you define them?
In php how can you jump in to and out of "php mode"?
What is __ invoke in php?
"$this" what type of object it is?
i want simple programs in php and outputs and how to use in web developed side in php briefly explined in exmple