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 get a total number of elements used in the array?
Is it possible to use com component in php?
write a note on Testing the web site
What is the different between count() and sizeof() in php?
What is cms php?
What are the differences between echo and print?
Hello I m 1.5 exp, i want code : ms word to Html in php,retrieve the words in ms word in to dispaly browser in (same format,alignment). pls help me everybody Regards selva
Explain what is the difference between for and foreach?
What is the use of header() function in PHP? What the Limitation of HEADER()?
how can i find number of rows in a table using MS Access and php? i used odbc_num_rows($query); but it returned -1.
What is helper library?
what is abstrac class? why it is use?