Computer Science, asked by kodavatiadilakshmi02, 9 months ago

write a algorithm to determine if a given string contains a balanced sequence of parentheses​

Answers

Answered by Anonymous
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