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

What is a reverse linked list.

0 Answers   Aspiring Minds,


What is advantage and disadvantage of linked list?

0 Answers  


How many types of sorting algorithms are there?

0 Answers  


Explain binary searching, Fibinocci search.

5 Answers   CTS, IBM, TCS,


Which collection class is thread safe?

0 Answers  






Why is hashset used?

0 Answers  


When should structures be passed by values or by reference?

0 Answers   Tech Mahindra,


Which interfaces are implemented by concurrentskiplistset?

0 Answers  


Can we add elements to final list?

0 Answers  


How does the bubble sort work?

0 Answers  


How are the elements of a 2d array are stored in the memory?

0 Answers  


Explain about the types of linked lists

5 Answers  


Categories