How do I create a program using stack to check balanced parenthesis in an expression? | SoloLearn: Learn to code for FREE!

+1

How do I create a program using stack to check balanced parenthesis in an expression?

https://photos.app.goo.gl/r4zKHpTGwoVHMVzW9

4/16/2021 6:51:40 AM

Mohammed Ramadhan

4 Answers

New Answer

+7

Iterate through expression. If u find ( , push to stack. If you find ) pop from stack. If stack is empty although u find ) => not balanced If stack is not empty at end of expression => not balanced

+2

Thanks let me try

0

What a question?

0

Check the link for more info