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



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

Answer / rohit sah

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.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Write a program for Sorting an Array. Which sorting will you prefer?

0 Answers  


How to increase stack limit in w3wp.exe?

0 Answers   PUCIT,


Explain singly linked list in short.

0 Answers  


What is a singletonlist?

0 Answers  


Is copyonwritearraylist thread safe?

0 Answers  






State the difference between persistent and ephemeral data structure?

0 Answers  


What is scalar example?

0 Answers  


What is time complexity of binary search?

0 Answers  


Is arraylist a list?

0 Answers  


Is arraylist synchronized?

0 Answers  


What are lists?

0 Answers  


Why entry interface is used in map?

0 Answers  


Categories