

MCQOPTIONS
Saved Bookmarks
This section includes 13 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which of the following is incorrect with respect to binary trees? |
A. | Let T be a binary tree. For every k ≥ 0, there are no more than 2k nodes in level k |
B. | Let T be a binary tree with λ levels. Then T has no more than 2λ – 1 nodes |
C. | Let T be a binary tree with N nodes. Then the number of levels is at least ceil(log (N + 1)) |
D. | Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1)) |
Answer» E. | |
2. |
In a full binary tree if there are L leaves, then total number of nodes N are? |
A. | N = 2*L |
B. | N = L + 1 |
C. | N = L – 1 |
D. | N = 2*L – 1 |
Answer» E. | |
3. |
In a full binary tree if number of internal nodes is I, then number of nodes N are? |
A. | N = 2*I |
B. | N = I + 1 |
C. | N = I – 1 |
D. | N = 2*I + 1 |
Answer» E. | |
4. |
What is the average case time complexity for finding the height of the binary tree? |
A. | h = O(loglogn) |
B. | h = O(nlogn) |
C. | h = O(n) |
D. | h = O(log n) |
Answer» E. | |
5. |
IN_A_FULL_BINARY_TREE_IF_THERE_ARE_L_LEAVES,_THEN_TOTAL_NUMBER_OF_NODES_N_ARE??$ |
A. | N = 2L |
B. | N = L + 1 |
C. | N = L – 1 |
D. | N = 2L – 1 |
Answer» E. | |
6. |
Which_of_the_following_is_correct_with_respect_to_binary_trees?$ |
A. | Let T be a binary tree. For every k ‚â• 0, there are no more than 2k nodes in level k |
B. | Let T be a binary tree with λ levels. Then T has no more than 2<sup>λ – 1</sup> nodes |
C. | Let T be a binary tree with N nodes. Then the number of levels is at least ceil(log (N + 1)) |
D. | All of the mentioned |
Answer» E. | |
7. |
In a full binary tree if number of internal nodes is I, then number of leaves L are? |
A. | L = 2I |
B. | L = I + 1 |
C. | L = I – 1 |
D. | L = 2I – 1 |
Answer» C. L = I ‚Äö√Ñ√∂‚àö√ë‚àö¬® 1 | |
8. |
Which of the following is not an advantage of trees? |
A. | Hierarchical structure |
B. | Faster search |
C. | Router algorithms |
D. | Undo/Redo operations in a notepad |
Answer» E. | |
9. |
What is the time complexity for finding the height of the binary tree? |
A. | h = O(loglogn) |
B. | h = O(nlogn) |
C. | h = O(n) |
D. | h = O(log n) |
Answer» E. | |
10. |
What is a complete binary tree? |
A. | Each node has exactly zero or two children |
B. | A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left |
C. | A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right |
D. | None of the mentioned |
Answer» D. None of the mentioned | |
11. |
What is a full binary tree? |
A. | Each node has exactly zero or two children |
B. | Each node has exactly two children |
C. | All the leaves are at the same level |
D. | Each node has exactly one or two children |
Answer» B. Each node has exactly two children | |
12. |
The number of edges from the node to the deepest leaf is called _________ of the tree. |
A. | Height |
B. | Depth |
C. | Length |
D. | None of the mentioned |
Answer» B. Depth | |
13. |
The number of edges from the root to the node is called __________ of the tree. |
A. | Height |
B. | Depth |
C. | Length |
D. | None of the mentioned |
Answer» C. Length | |