Algorithm: • Declare a character stack S. • Now traverse the expression string exp. 1. If the current character is a starting bracket ("(' or '{' or'I') then push it to stack. 2. If the current...


Write the following algorithm in C language.


Algorithm:<br>• Declare a character stack S.<br>• Now traverse the expression string exp.<br>1. If the current character is a starting bracket (

Extracted text: Algorithm: • Declare a character stack S. • Now traverse the expression string exp. 1. If the current character is a starting bracket ("(' or '{' or'I') then push it to stack. 2. If the current character is a closing bracket (')' or '}' or 'I') then pop from stack and if the popped character is the matching starting bracket then fine else brackets are not balanced. • After complete traversal, if there is some starting bracket left in stack then "not balanced"

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here