Complete Binary Tree MCQ Quiz in मल्याळम - Objective Question with Answer for Complete Binary Tree - സൗജന്യ PDF ഡൗൺലോഡ് ചെയ്യുക
Last updated on Mar 10, 2025
Latest Complete Binary Tree MCQ Objective Questions
Top Complete Binary Tree MCQ Objective Questions
Complete Binary Tree Question 1:
In a full binary tree number of nodes is 63 then the height of the tree is:
Answer (Detailed Solution Below)
Complete Binary Tree Question 1 Detailed Solution
Concept:
A full binary tree (sometimes proper binary tree or 2-tree) is a tree in which every node other than the leaves has two children.
Graph with height 5:
The maximum number of nodes present: 63
Tips and Tricks:
If n is number of nodes and h is minimum height of in a binary search tree, then
2h+1 – 1 = n
2h+1 – 1 = 63
2h+1 = 64
∴2h+1 = 26
∴ h = 5
if h is ≥ 5 then 63 nodes are possible and hence option 4 is the correct answer.
In a full binary tree number of nodes is 63 then the height of the tree ≥ 5
Complete Binary Tree Question 2:
A binary tree is a full binary tree in which all the internal nodes have two children and all the leaf nodes are present in the same level. Find the no of nodes in a full binary tree of height ‘h’? Assume root is at height 0
Answer (Detailed Solution Below)
Complete Binary Tree Question 2 Detailed Solution
Consider the following full binary tree of height 3
no. of nodes
1 (20+1-1) |
3 (21+1-1) |
7 (22+1-1) |
15 (23+1-1) |
(for any height) h 2h+1-1
Complete Binary Tree Question 3:
Consider the height of a tree as the number of edges in the longest path between the root node and leaf nodes. If T is a binary tree of height 3, then what is the smallest and largest number of nodes that T can have?
Answer (Detailed Solution Below)
Complete Binary Tree Question 3 Detailed Solution
The correct answer is option 3.
Concept:
The height of a binary tree is the height of the root node in the whole binary tree. In other words, the height of a binary tree is equal to the largest number of edges from the root to the most distant leaf node
The given height is = 3,
smallest nodes= 4
If the tree is a left skew tree or a right skew tree then nodes will be 4 with height 3.
Largest nodes= 15
If the tree is a full binary tree then nodes will be 15 with a height of 3.
Hence the correct answer is Smallest: 4, Largest: 15.
Complete Binary Tree Question 4:
What will be the number of leaf nodes in a complete binary tree if depth is m.
Answer (Detailed Solution Below)
Complete Binary Tree Question 4 Detailed Solution
Answer: Option 4
Explanation:
This type of "number of nodes in a tree" type Questions can be solved by taking an example
Consider the following example
In this Complete Binary tree, we have height of the tree is 3 and no of leaf nodes is 8.
Hence we can generalize this and can say that number of leaf nodes in a complete binary tree of depth/height m is 2m.
Complete Binary Tree Question 5:
If T is a binary tree with number of levels as L, then the number of leaf nodes in the binary tree is at most:
Answer (Detailed Solution Below)
Complete Binary Tree Question 5 Detailed Solution
Concept:
Level is the number of nodes on path from root to the node.
Explanation:
If T is a binary tree with number of levels as L, then number of leaf nodes in the binary tree is at most 2L-1.
Consider, tree has only one level, then number of nodes = 21-1 = 20 = 1
It means tree will have only one node i.e. root
If tree has two levels, then maximum nodes possible at that level = 22-1 = 2
i.e. maximum 2 leafs are possible and 3 total nodes are possible with 2 levels.
Similarly, if we take 3 levels, number of nodes that level = 23-1 = 4
i.e. maximum leaf nodes possible = 4 and total nodes = 7
So, if we take level as L, total leaf nodes possible are atmost 2L-1.Complete Binary Tree Question 6:
In a complete 3-ary, every internal node has exactly 3 children. The number of leaves in such a tree with k internal nodes is
Answer (Detailed Solution Below)
Complete Binary Tree Question 6 Detailed Solution
Consider an example:
k = 2(internal nodes)
leaves = 2k + 1 = 2 × 3 - 1 = 5
satisfies the case
Tips and Tricks:
If n- ary tree with k internal nodes, then number of leaves:
L = (n – 1) × k + 1
L = (3 – 1) k + 1
∴ L = 2k + 1Complete Binary Tree Question 7:
Match the column A with the items present in column B:
Column A: |
Column B: |
1. Maximum size of an array to store a binary tree with 'n' nodes | p. log2n |
2. Maximum height possible for a binary tree with 'n' nodes | q. 2n-1 |
3. Minimum height possible for a binary tree with 'n' nodes | r. n |
Answer (Detailed Solution Below)
Complete Binary Tree Question 7 Detailed Solution
The correct order is: 1-q, 2-r, 3-p
Maximum size of an array to store a binary tree with 'n' nodes: 2n-1
Maximum height possible for a binary tree with 'n' nodes: n
Minimum height possible for a binary tree with 'n' nodes: log2n
Complete Binary Tree Question 8:
The number of nodes in a complete binary tree of level 5 is______.
Answer (Detailed Solution Below)
Complete Binary Tree Question 8 Detailed Solution
Key Points
- A complete binary tree of level 5 has 63 nodes.
- In a complete binary tree, the total number of nodes is given by the formula: 2^(L+1) - 1, where L is the level number.
- For level 5, the calculation is: 2^(5+1) - 1 = 2^6 - 1 = 64 - 1 = 63.
- This structure ensures that all levels except possibly the last are completely filled, and all nodes are as far left as possible.
Additional Information
- Binary trees are fundamental data structures used in computer science for various applications, including searching and sorting algorithms.
- In a complete binary tree, every level, except possibly the last, is completely filled, making it an efficient structure for various operations.
- The properties of binary trees make them useful in implementing binary search trees (BST), heaps, and priority queues.
- Understanding the structure and properties of complete binary trees is essential for optimizing performance in algorithm design.
Complete Binary Tree Question 9:
The number of nodes in a complete binary tree of height 5 is
Answer (Detailed Solution Below)
Complete Binary Tree Question 9 Detailed Solution
The correct answer is option 2
CONCEPT:
A Binary tree is a tree that contains nodes that can have zero, one, or two child nodes.
A complete binary tree is a binary tree in which every level is completely filled, except possibly the last, and all nodes are as far left as possible.
Calculation:
Number of nodes at height 0 = 20 = 1
Number of nodes at height 1 = 21 = 2
Number of nodes at height 2 = 22 = 4
Number of nodes at height 3 = 23 = 8
Number of nodes at height 4 = 24 = 16
Number of nodes at height 5 = 25 = 32
So total number of nodes = 1 + 2 + 4 + 8 + 16 + 32 =63
So option 2 is correct
Alternate Method
Graph with height 5:
The maximum number of nodes present: 63
If n is the number of nodes and h is the minimum height of in a binary search tree, then
n = 2h+1 – 1
n = 25+1 – 1
∴ n = 63
Complete Binary Tree Question 10:
Tress and Graphs are example of _________.
Answer (Detailed Solution Below)
Complete Binary Tree Question 10 Detailed Solution
The correct answer is Non-linear data structure.
Key Points
- Trees and graphs are classified as non-linear data structures.
- Unlike linear data structures (like arrays and linked lists), non-linear data structures do not store data elements in a sequential manner.
- In a tree, data is organized in a hierarchical structure with a root element and sub-elements (children).
- Graphs consist of nodes (vertices) connected by edges, which can represent various relationships between the nodes.
- Non-linear data structures are useful for representing complex relationships and hierarchical data.
Additional Information
- Trees are widely used in databases, file systems, and network routing algorithms.
- Graphs are used in social networks, web page ranking algorithms, and to represent transportation networks.
- Common operations on trees include traversal (in-order, pre-order, post-order) and manipulation (insertion, deletion).
- Graph operations include traversal (depth-first search, breadth-first search), shortest path finding, and network flow analysis.