write a algorithm to determine if a given string contains a balanced sequence of parentheses
Answers
Answered by
2
Answer:
Algorithm:
Declare a character stack S.
Now traverse the expression string exp. If the current character is a starting bracket ('(' or '{' or '[') then push it to stack. ...
After complete traversal, if there is some starting bracket left in stack then “not balanced”
Similar questions