MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The data structure required to check whether an expression contains balanced parenthesis is?
A
Stack
B
Queue
C
Array
D
Tree
Explanation: 

Detailed explanation-1: -The answer is stack. The data structure required to check whether an expression contains balanced parenthesis is a stack. This is a simple data structure in which elements can be added and removed in a specific order. In other words, it follows a LIFO or a FILO structure.

Detailed explanation-2: -Answer: The data structure required to check whether an expression contains balanced paranthesis is Stack. It is an abstract data type and data structure which can be used for paranthesis checking.

Detailed explanation-3: -Algorithm 1-Using Stack In this approach, the parenthesis checker is implemented using a stack data structure.

There is 1 question to complete.