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
Why we need cursor implementation of linked lists?
Why hashtable is faster than arraylist?
Does the minimal spanning tree of a graph give the shortest distance between any 2 specified nodes?
How does hashset work internally in java?
What is Insertion sort, selection sort, bubble sort( basic differences among the functionality of the three sorts and not the exact algorithms)?
What are the benefits of using arrays?
How can we delete the first node from the singly linked list?
What are the different types of sorting? Explain the difference between them.
Why do we use hashset?
What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?
What do you know about the big-o notation and can you give some examples with respect to different data structures?
Which is faster binary or linear search?
Define rehashing?
How are the elements of a 2d array are stored in the memory?
Which interfaces are implemented by enumset?