Write a function that takes "depth" as argument and return
sum of node's data of that depth.
For instance,
(0) depth 0
/ \
(10) (20) depth 1
/ \
(40) (50) depth2
If I pass get_sum_by_depth(2) ,
it would return 90 (i.e. 40 + 50 )
No Answer is Posted For this Question
Be the First to Post Answer
what is the difference between mysql_fetch_array() and mysql_fetch_row()?
How to Define a Constant in PHP? Is $ symbol necessary?
What are the variables in php?
What is the mysql injection?
What is the difference between for and foreach?
Can we extend two classes in php?
What are new features in php 7?
write code to find the date difference b/w two given date using PHP not MYSQL function?
3 Answers HyperQuality, Synctra Solutions,
How to declare an array in php?
How can we submit a form without a submit button?
23 Answers ABC, HCL, Infosys, Kept Bug, Panys, Rushmore Consultancy, Torque Infotech, Wipro, zCon Solutions,
What is use of preg_replace in php?
Tell me how can we change the maximum size of the files to be uploaded?