GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Structures
Go To First  |  Previous Question  |  Next Question 
 Data Structures  |  Question 129 of 202    Print  
If the depth of a tree is 3 levels, then what is the Size of the Tree?
Skill/Topic: Tree
A) 8
Explanation: You calculate the size of a tree by using the following formula: size = 2 ^ depth If the depth is 3 levels, then the size is 8, as shown here: 8 = 2 ^ 3



  
Total Answers and Comments: 3 Last Update: October 31, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 27, 2006 04:04:48   #1  
shyam        

RE: If the depth of a tree is 3 levels, then what is t...

the answer is (2 to power 3)-1

i.e 7


 
Is this answer useful? Yes | No
March 04, 2006 15:49:14   #2  
bigroast Member Since: March 2006   Contribution: 1    

RE: If the depth of a tree is 3 levels, then what is t...
I agree that it would be 7. Isn't it a Fibonacci sequence? I also assume it's a binary tree.
 
Is this answer useful? Yes | No
October 31, 2006 01:34:16   #3  
f2003062 Member Since: October 2006   Contribution: 7    

RE: If the depth of a tree is 3 levels, then what is t...
We can not say..!First of all it depends on the type of the tree (Ex:binary Tree)...Even if it is a binary tree we can not define its size using its depth..For example look at the following tree 15 / 13 NULL / 10 14In the above binary Tree the depth of is 3 but the size is 4 The NULL node is not considered when we calculating the size of the Tree right..!
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape