1.

If the corresponding end bracket/braces/parentheses is encountered, which of the following is done?(a) push it on to the stack(b) pop the stack(c) throw an error(d) treated as an exceptionThis interesting question is from Application of Stacks topic in section Application of Stacks of Data Structures & Algorithms IThe question was posed to me during an interview.

Answer»

Right option is (b) pop the STACK

The explanation is: When the CORRESPONDING end bracket/braces/parentheses is encountered, the stack is POPPED. When an opening bracket/braces/parentheses is encountered, it is PUSHED on to the stack.



Discussion

No Comment Found

Related InterviewSolutions