Almost Complete Binary Tree MCQ Quiz - Objective Question with Answer for Almost Complete Binary Tree - Download Free PDF
Last updated on Jun 6, 2025
Latest Almost Complete Binary Tree MCQ Objective Questions
Almost Complete Binary Tree Question 1:
Which of the following algorithms are based on the Breadth First Search (BFS)?
A. Prim's algorithms
B. Kruskal algorithms
C. Dijkstra algorithms
D. Greedy algorithms
E. Dynamic Programming
Choose the correct answer from the options given below:
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 1 Detailed Solution
The correct answer is Option 4.
Key Points
- Prim's Algorithm:
- Prim's Algorithm is used to find the Minimum Spanning Tree (MST) for a weighted undirected graph.
- It starts from an arbitrary node and explores all the adjacent nodes using BFS to find the edge with the smallest weight that connects the tree to a new vertex.
- It continues this process until all vertices are included in the MST.
- Dijkstra's Algorithm:
- Dijkstra's Algorithm is used for finding the shortest paths between nodes in a graph.
- It starts from the source node and uses BFS to explore all possible paths to other nodes, selecting the path with the smallest cumulative weight.
- It is particularly useful for graphs with non-negative weights.
Additional Information
- Both Prim's and Dijkstra's algorithms rely on the BFS approach to explore nodes level by level, ensuring that the shortest path or smallest weight edge is chosen at each step.
- Prim's Algorithm is specifically used for creating MSTs, whereas Dijkstra's is for shortest path problems.
- While BFS is a fundamental concept, both algorithms incorporate additional logic, such as priority queues, to optimize their respective goals.
Almost Complete Binary Tree Question 2:
Which of the following description(s) is/are true:
A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.
B. Trie - Used for efficient prefix - based searches.
C. AVL Tree - self balancing binary search tree with stricker balance criteria.
D. B - Tree - Allows efficient search, inert, delete operations in disk based system.
Choose the correct answer from the options given below:
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 2 Detailed Solution
The Correct answer is : A, B, C & D are correct.Key Points
- A. Red Black Tree: ✅ True
A Red-Black Tree is a self-balancing BST that guarantees O(log n) time for search, insert, and delete operations in the worst case. - B. Trie: ✅ True
Tries (prefix trees) are used for efficient prefix-based searching and are common in applications like autocomplete and dictionary lookups. - C. AVL Tree: ✅ True
AVL Trees are also self-balancing BSTs with a stricter balancing condition than Red-Black Trees (balance factor must be -1, 0, or 1). So this statement is also true. - D. B-Tree: ✅ True
B-Trees are optimized for disk-based storage systems and support efficient search, insert, and delete operations with fewer disk reads.
Conclusion: All options A, B, C, and D are correct.
Almost Complete Binary Tree Question 3:
In a binary tree, the number of internal nodes of degree 1 is 12, and the number of internal nodes of degree 2 is 29. The number of leaf nodes in the binary tree is _____.
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 3 Detailed Solution
Data:
Internal node with degree 1 = i = 12
Internal node with degree 2 = n = 29
Formula:
number of leaf nodes = n + 1
Calculation:
number of leaf nodes = 29 + 1 = 30
Examples:
It has 4 internal nodes with degree 2
∴ number of leaf nodes is 4 + 1 = 5.
Almost Complete Binary Tree Question 4:
Which of the following are correct statements regarding splay trees?
(a) Every single operation is guaranteed to be efficient
(b) Avoids worst case linear time behaviour of BST operations
(c) Guaranteed that a series of a m operations will take O (m log n) time for a tree of m nodesAnswer (Detailed Solution Below)
Almost Complete Binary Tree Question 4 Detailed Solution
In splay tree, the node that is inserted in the last will become the root of the tree. Splay tree are the self-adjusting form of binary search tree. In an n node splay tree, all the search tree operations takes O(log n) time.
- Every single operation in splay tree cannot be guaranteed to be efficient since element on which operation(search) is performed may not be root.
- for sufficiently long access sequences, splay trees are very efficient as they use a simple restructuring method.
- They avoid the worst-case time of all operations of binary search tree.
Almost Complete Binary Tree Question 5:
Build a binary-max heap(one by one element inserted) from the elements 30, 15, 18, 12, 23, 10, 14, 22, 25 using an array. What is the content of the array after two delete operations?
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 5 Detailed Solution
Max heap:
Deletion of 30
Deletion of 25
Sequence of Array element: 23, 22, 18, 12, 15, 10, 14
Important Points:
Since only two search keys (30 and 25) are missing in the option those two keys have been deleted.
Top Almost Complete Binary Tree MCQ Objective Questions
Consider a binary tree T that has 200 leaf nodes. Then, the number of nodes in T that have exactly two children are ________.
Answer (Detailed Solution Below) 199
Almost Complete Binary Tree Question 6 Detailed Solution
Download Solution PDFTypes of nodes in a Binary Tree:
Interval (i):
(i) Root node (single node), degree = 2
(ii) Node with 1 child, degree = 2
(iii) Non root node with 2 children, degree = 3
Load (l):
Degree = 1
Total nodes = n = i + l
Also \(\mathop \sum \limits_{i = l}^n {d_i} = 2\left( {n - 1} \right)\)
\(2 + {i_1} \times 2 + {i_2} \times 3 + l \times 1 = 2\left( {n - 1} \right)\)
Also, \(n = 1 + {i_1} + {i_2} + l\)
\(\begin{array}{l} {i_1} = n - l - {i_2} - 1\\ \therefore 2 + \left( {n - l - {i_2} - 1} \right) \times 2 + {i_2} \times 3 + l \times 1 \end{array}\)
= 2n – 2
\(\begin{array}{l} {i_2} - l = - 2\\ {i_2} = l - 2 \end{array}\)
Also, Total number of interval nodes with
2 children = i2 + 1(root)
\(= l-2 + 1 = l-1\)
= 200 - 1 = 199
Which of the following algorithms are based on the Breadth First Search (BFS)?
A. Prim's algorithms
B. Kruskal algorithms
C. Dijkstra algorithms
D. Greedy algorithms
E. Dynamic Programming
Choose the correct answer from the options given below:
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 7 Detailed Solution
Download Solution PDFThe correct answer is Option 4.
Key Points
- Prim's Algorithm:
- Prim's Algorithm is used to find the Minimum Spanning Tree (MST) for a weighted undirected graph.
- It starts from an arbitrary node and explores all the adjacent nodes using BFS to find the edge with the smallest weight that connects the tree to a new vertex.
- It continues this process until all vertices are included in the MST.
- Dijkstra's Algorithm:
- Dijkstra's Algorithm is used for finding the shortest paths between nodes in a graph.
- It starts from the source node and uses BFS to explore all possible paths to other nodes, selecting the path with the smallest cumulative weight.
- It is particularly useful for graphs with non-negative weights.
Additional Information
- Both Prim's and Dijkstra's algorithms rely on the BFS approach to explore nodes level by level, ensuring that the shortest path or smallest weight edge is chosen at each step.
- Prim's Algorithm is specifically used for creating MSTs, whereas Dijkstra's is for shortest path problems.
- While BFS is a fundamental concept, both algorithms incorporate additional logic, such as priority queues, to optimize their respective goals.
Which of the following description(s) is/are true:
A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.
B. Trie - Used for efficient prefix - based searches.
C. AVL Tree - self balancing binary search tree with stricker balance criteria.
D. B - Tree - Allows efficient search, inert, delete operations in disk based system.
Choose the correct answer from the options given below:
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 8 Detailed Solution
Download Solution PDFThe Correct answer is : A, B, C & D are correct.Key Points
- A. Red Black Tree: ✅ True
A Red-Black Tree is a self-balancing BST that guarantees O(log n) time for search, insert, and delete operations in the worst case. - B. Trie: ✅ True
Tries (prefix trees) are used for efficient prefix-based searching and are common in applications like autocomplete and dictionary lookups. - C. AVL Tree: ✅ True
AVL Trees are also self-balancing BSTs with a stricter balancing condition than Red-Black Trees (balance factor must be -1, 0, or 1). So this statement is also true. - D. B-Tree: ✅ True
B-Trees are optimized for disk-based storage systems and support efficient search, insert, and delete operations with fewer disk reads.
Conclusion: All options A, B, C, and D are correct.
Almost Complete Binary Tree Question 9:
In a binary tree, the number of internal nodes of degree 1 is 12, and the number of internal nodes of degree 2 is 29. The number of leaf nodes in the binary tree is _____.
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 9 Detailed Solution
Data:
Internal node with degree 1 = i = 12
Internal node with degree 2 = n = 29
Formula:
number of leaf nodes = n + 1
Calculation:
number of leaf nodes = 29 + 1 = 30
Examples:
It has 4 internal nodes with degree 2
∴ number of leaf nodes is 4 + 1 = 5.
Almost Complete Binary Tree Question 10:
Build a binary-max heap(one by one element inserted) from the elements 30, 15, 18, 12, 23, 10, 14, 22, 25 using an array. What is the content of the array after two delete operations?
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 10 Detailed Solution
Max heap:
Deletion of 30
Deletion of 25
Sequence of Array element: 23, 22, 18, 12, 15, 10, 14
Important Points:
Since only two search keys (30 and 25) are missing in the option those two keys have been deleted.
Almost Complete Binary Tree Question 11:
Consider a binary tree T that has 200 leaf nodes. Then, the number of nodes in T that have exactly two children are ________.
Answer (Detailed Solution Below) 199
Almost Complete Binary Tree Question 11 Detailed Solution
Types of nodes in a Binary Tree:
Interval (i):
(i) Root node (single node), degree = 2
(ii) Node with 1 child, degree = 2
(iii) Non root node with 2 children, degree = 3
Load (l):
Degree = 1
Total nodes = n = i + l
Also \(\mathop \sum \limits_{i = l}^n {d_i} = 2\left( {n - 1} \right)\)
\(2 + {i_1} \times 2 + {i_2} \times 3 + l \times 1 = 2\left( {n - 1} \right)\)
Also, \(n = 1 + {i_1} + {i_2} + l\)
\(\begin{array}{l} {i_1} = n - l - {i_2} - 1\\ \therefore 2 + \left( {n - l - {i_2} - 1} \right) \times 2 + {i_2} \times 3 + l \times 1 \end{array}\)
= 2n – 2
\(\begin{array}{l} {i_2} - l = - 2\\ {i_2} = l - 2 \end{array}\)
Also, Total number of interval nodes with
2 children = i2 + 1(root)
\(= l-2 + 1 = l-1\)
= 200 - 1 = 199
Almost Complete Binary Tree Question 12:
Which of the following are correct statements regarding splay trees?
(a) Every single operation is guaranteed to be efficient
(b) Avoids worst case linear time behaviour of BST operations
(c) Guaranteed that a series of a m operations will take O (m log n) time for a tree of m nodesAnswer (Detailed Solution Below)
Almost Complete Binary Tree Question 12 Detailed Solution
In splay tree, the node that is inserted in the last will become the root of the tree. Splay tree are the self-adjusting form of binary search tree. In an n node splay tree, all the search tree operations takes O(log n) time.
- Every single operation in splay tree cannot be guaranteed to be efficient since element on which operation(search) is performed may not be root.
- for sufficiently long access sequences, splay trees are very efficient as they use a simple restructuring method.
- They avoid the worst-case time of all operations of binary search tree.
Almost Complete Binary Tree Question 13:
Which of the following algorithms are based on the Breadth First Search (BFS)?
A. Prim's algorithms
B. Kruskal algorithms
C. Dijkstra algorithms
D. Greedy algorithms
E. Dynamic Programming
Choose the correct answer from the options given below:
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 13 Detailed Solution
The correct answer is Option 4.
Key Points
- Prim's Algorithm:
- Prim's Algorithm is used to find the Minimum Spanning Tree (MST) for a weighted undirected graph.
- It starts from an arbitrary node and explores all the adjacent nodes using BFS to find the edge with the smallest weight that connects the tree to a new vertex.
- It continues this process until all vertices are included in the MST.
- Dijkstra's Algorithm:
- Dijkstra's Algorithm is used for finding the shortest paths between nodes in a graph.
- It starts from the source node and uses BFS to explore all possible paths to other nodes, selecting the path with the smallest cumulative weight.
- It is particularly useful for graphs with non-negative weights.
Additional Information
- Both Prim's and Dijkstra's algorithms rely on the BFS approach to explore nodes level by level, ensuring that the shortest path or smallest weight edge is chosen at each step.
- Prim's Algorithm is specifically used for creating MSTs, whereas Dijkstra's is for shortest path problems.
- While BFS is a fundamental concept, both algorithms incorporate additional logic, such as priority queues, to optimize their respective goals.
Almost Complete Binary Tree Question 14:
Which of the following description(s) is/are true:
A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.
B. Trie - Used for efficient prefix - based searches.
C. AVL Tree - self balancing binary search tree with stricker balance criteria.
D. B - Tree - Allows efficient search, inert, delete operations in disk based system.
Choose the correct answer from the options given below:
Answer (Detailed Solution Below)
Almost Complete Binary Tree Question 14 Detailed Solution
The Correct answer is : A, B, C & D are correct.Key Points
- A. Red Black Tree: ✅ True
A Red-Black Tree is a self-balancing BST that guarantees O(log n) time for search, insert, and delete operations in the worst case. - B. Trie: ✅ True
Tries (prefix trees) are used for efficient prefix-based searching and are common in applications like autocomplete and dictionary lookups. - C. AVL Tree: ✅ True
AVL Trees are also self-balancing BSTs with a stricter balancing condition than Red-Black Trees (balance factor must be -1, 0, or 1). So this statement is also true. - D. B-Tree: ✅ True
B-Trees are optimized for disk-based storage systems and support efficient search, insert, and delete operations with fewer disk reads.
Conclusion: All options A, B, C, and D are correct.
Almost Complete Binary Tree Question 15:
The elements 30, 15, 18, 12, 23, 10, 14, 22, 25 are inserted one by one in the given order into a MAX-HEAP. What is the index of the element 25
after the MAX-HEAP is built?
Note: the index of the root is 1?
Answer (Detailed Solution Below) 2
Almost Complete Binary Tree Question 15 Detailed Solution
Max heap:
Level Order Traversal
1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |
30 | 25 | 18 | 23 | 15 | 10 | 14 | 12 | 22 |
Therefore 25 will be at index 2.