There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?

View previous topic View next topic Go down

There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?

Post  Admin on Sun Jan 31, 2010 7:22 am

15.
In general:
There are 2n-1 nodes in a full binary tree.
By the method of elimination:
Full binary trees contain odd number of nodes. So there cannot be full binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 15.
Note:
Full and Complete binary trees are different. All full binary trees are complete binary trees but not vice versa.

Admin
Admin

Posts : 71
Join date : 2010-01-21

View user profile http://campus-interview.co.cc

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum