Data Structures MCQs with Answers
Practice important Data Structures MCQs with answers and explanations.
Multiple Choice Questions
Q461: In a complete binary tree, where is the right child of a node located if it is at position i in an array?
- A: 2 * i + 1
- B: 2 * i
- C: i + 1
- D: 2 * (i + 2)
View Answer
A
Q462: What is the purpose of level-order traversal in a complete binary tree?
- A: To store the tree in an array efficiently
- B: To find the inorder traversal
- C: To find the height of the tree
- D: To traverse the tree in depth-first order
View Answer
A
Q463: What does the floor(i / 2) formula determine in the context of a complete binary tree stored in an array?
- A: The parent node position
- B: The left child node position
- C: The right child node position
- D: The sibling node position
View Answer
A
Q464: Which of the following statements is true about a complete binary tree?
- A: It can be stored in an array with indices
- B: It is always a binary search tree
- C: It is always perfectly complete
- D: It always requires pointers for traversal
View Answer
A
Q465: What is a unique feature of a complete binary tree when compared to a perfect binary tree?
- A: The last level is not necessarily fully filled
- B: All nodes have exactly two children
- C: All levels are completely filled
- D: The tree is not balanced
View Answer
A
Q466: What is the purpose of using the fastInorder routine instead of a recursive inorder traversal?
- A: To avoid the use of stack and recursion
- B: To find the level-order traversal
- C: To traverse the tree in postorder
- D: To use additional memory
View Answer
A
Q467: What is a Complete Binary Tree?
- A: A tree where all levels are fully filled except possibly the last one
- B: A tree where every node has two children
- C: A tree with a single node
- D: A tree with nodes arranged in a linked list
View Answer
A
Q468: Why are arrays not ideal for storing incomplete binary trees?
- A: Arrays require contiguous memory allocation
- B: Arrays cannot handle dynamic size changes
- C: Arrays have fixed sizes
- D: Arrays have memory wastage due to empty positions
View Answer
D
Q469: In a min-heap, what property must be satisfied for every node?
- A: The node value must be greater than its children
- B: The node value must be smaller than its children
- C: The node value must be equal to its children
- D: The node value must be random with respect to children
View Answer
B
Q470: What happens when you remove the root node from a min-heap?
- A: The tree is destroyed
- B: The remaining values are rearranged to form a new heap
- C: The root node is replaced with the maximum value
- D: The heap property is violated permanently
View Answer
B