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 are the different loops in php?
Why print_r is used in php?
Explain about require and include function?
What are the different types of array in php?
Differentiate echo vs. Print statement.
Is null or empty c#?
Tell me what is the difference between the functions strstr() and stristr()?
What is a PHP accelerator?
Which is better php praogramming or cad/cam scope wise and also salaray wise?
How a variable is declared in php?
What is a query in a database?
What is difference between $x and $$x
5 Answers Mindex, Net Solution, Procon IT Solutions, Trigent,