Which data structure is commonly used to check whether parentheses are balanced in an expression?
Options
- A. Queue
- B. Linked List
- C. Stack
- D. More than one of the above
- E. None of the above
Quiz Practice:
C. Stack
Correct Answer: C. Stack
Explanation: Stack is used to check balanced parentheses.
Example: (A+B) is balanced, whereas (A+B is not balanced.