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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Does hashmap allow null keys?

472


Why set will not allow duplicates?

497


What is data algorithm?

502


What is top in stack?

453


What is the purpose of thread?

510






Is hashset thread safe?

483


How many parts are there in a declaration statement?

542


What is a singletonlist?

492


To describe the Complexity of Binary search, Quicksort and various other sorting and searching techniques..

566


How do you find the index of an element in an arraylist?

441


What is the space complexity of bubble sort?

526


Will this code give error if I try to add two heterogeneous elements in the arraylist? And why?

502


What method is used to place a value onto the top of a stack?

571


Define linear probing?

589


Describe the complexity of Quick Sort

552