MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following data structures can be used for parentheses matching?
A
n-ary tree
B
priority queue
C
stack
D
queue
Explanation: 

Detailed explanation-1: -Stack can be used for evaluating arithmetic expression. (Postfix, prefix evaluation). It can be used for conversion from one expression to another. It can be used to check matching parenthesis in any expression.

Detailed explanation-2: -Stack is a straightforward choice for checking if left and right parentheses are balanced.

Detailed explanation-3: -Boyer Moore Algorithm: This algorithm uses best heuristics of Naive and KMP algorithm and starts matching from the last character of the pattern. Using the Trie data structure: It is used as an efficient information retrieval data structure.

Detailed explanation-4: -The stack data structure is a linear data structure that accompanies a principle known as LIFO (Last In First Out) or FILO (First In Last Out).

There is 1 question to complete.