Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

what is the difference between mysql_fetch_array() and mysql_fetch_row()?

17 Answers   Google,


How to Define a Constant in PHP? Is $ symbol necessary?

6 Answers   Maples,


What are the variables in php?

0 Answers  


What is the mysql injection?

0 Answers  


What is the difference between for and foreach?

0 Answers  


Can we extend two classes in php?

0 Answers  


What are new features in php 7?

0 Answers  


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?

0 Answers  


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?

0 Answers  


Tell me how can we change the maximum size of the files to be uploaded?

0 Answers  


Categories