Question 10364 – Pipelining
November 12, 2023Relational-Algebra
November 12, 2023Question 9493 – GATE 2004
The best data structure to check whether an arithmetic expression has balanced parentheses is a
Correct Answer: B
Question 5 Explanation:
Stack is the best data structure to validate the arithmetic expression.
While evaluating when left parentheses occur then it push in to the stack, when right parentheses occur pop from the stack.
While at the end there is empty in the stack.
While evaluating when left parentheses occur then it push in to the stack, when right parentheses occur pop from the stack.
While at the end there is empty in the stack.
queue
stack
tree
list
Subscribe
Login
0 Comments