Data Structures MCQs with Answers
Practice important Data Structures MCQs with answers and explanations.
Multiple Choice Questions
Q111: Why might an array-based stack implementation be preferred over a linked list?
- A: Uses less memory overall
- B: Easier to resize dynamically
- C: Faster memory allocation
- D: Lower overhead for small datasets
View Answer
D
Q112: What is the primary disadvantage of using a linked list for stack implementation?
- A: Higher time complexity
- B: Limited memory space
- C: Extra memory required for pointers
- D: Harder to implement
View Answer
C
Q113: What does the expression A + B * C evaluate to in infix notation?
- A: A + B * C
- B: A + (B * C)
- C: (A + B) * C
- D: A * B + C
View Answer
B
Q114: How would you convert the infix expression A + B to postfix notation?
- A: A B +
- B: + A B
- C: A + B
- D: B A +
View Answer
A
Q115: Which operator has the highest precedence in arithmetic expressions?
- A: Addition
- B: Multiplication
- C: Exponentiation
- D: Subtraction
View Answer
C
Q116: What is the correct order of precedence for the operators in the expression A + B * C?
- A: Addition > Multiplication
- B: Multiplication > Addition
- C: Equal precedence
- D: Depends on the operands
View Answer
B
Q117: In postfix notation, how would the expression (A + B) * C be written?
- A: A B + C *
- B: A + B C *
- C: A B C + *
- D: (A + B) * C
View Answer
A
Q118: In stack implementation using an array, why is the isFull() method important?
- A: To avoid crashing the program
- B: To dynamically allocate more space
- C: To ensure the array is sorted
- D: To initialize the array
View Answer
A
Q119: What is the main reason for not using isFull() in a stack implemented with a linked list?
- A: Memory is managed dynamically
- B: Linked lists are infinite
- C: Nodes do not require memory
- D: The head pointer handles fullness
View Answer
A
Q120: What is the key difference between a stack implemented using an array and a linked list?
- A: Array is slower
- B: Linked list uses more memory
- C: Linked list does not have a fixed size
- D: Array supports dynamic resizing
View Answer
C