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
Does hashmap allow null keys?
Why set will not allow duplicates?
What is data algorithm?
What is top in stack?
What is the purpose of thread?
Is hashset thread safe?
How many parts are there in a declaration statement?
What is a singletonlist?
To describe the Complexity of Binary search, Quicksort and various other sorting and searching techniques..
How do you find the index of an element in an arraylist?
What is the space complexity of bubble sort?
Will this code give error if I try to add two heterogeneous elements in the arraylist? And why?
What method is used to place a value onto the top of a stack?
Define linear probing?
Describe the complexity of Quick Sort