Which of the following data structures can be used for parentheses matching?
Which of the following data structures can be used for parentheses matching? Correct Answer stack
For every opening brace, push it into the stack, and for every closing brace, pop it off the stack. Do not take action for any other character. In the end, if the stack is empty, then the input has balanced parentheses.
মোঃ আরিফুল ইসলাম
Feb 20, 2025