Question: Task - II: Given an expression string, write a program to examine whether the pairs and the orders of parenthesis { } , ( ,
Task II: Given an expression string, write a program to examine whether the pairs and the orders of parenthesis l are correct in expression. For example, if the input expression is entered by user is then the output should print "Balanced If the input: expression entered by user is then the output is Not Balanced Hint: Traverse the input string and use stack to push if you encounter an opening parenthesis and pop if you encounter a closing parenthesis of the same type
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
