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

Post New Answer

More PHP Interview Questions

Which methods should be used for sending an email using the variables $to, $subject, and $body?

0 Answers  


What are the delimiters in php?

0 Answers  


What are the features of php?

0 Answers  


What is if isset ($_ post submit )) in php?

0 Answers  


What are major variables in research?

0 Answers  






What is the content of /etc directory?

0 Answers  


What are the three classes of errors that can occur in php?

0 Answers  


How to enable cURL in PHP?

0 Answers   HCL,


How is it possible to return a value from a function?

0 Answers  


Is php the same as html?

0 Answers  


Why php is used?

0 Answers  


How is it possible to cast types in php?

0 Answers  


Categories