Check for Balanced Parentheses using Stack?
If the current character is a starting bracket ('(' or '{' or '[') then push it to stack. If the current character is a closing bracket (')' or '}' or ']') then pop from stack and if the popped character is the matching starting bracket then fine else brackets are not balanced.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between const and constexpr?
Why cstdlib is used in c++?
How many keywords are used in c++?
Why is c++ is better than c?
What are stacks? Give an example where they are useful.
What is the array and initializing arrays in c++?
What is difference c and c++?
How would you use the functions memcpy(), memset(), memmove()?
What is encapsulation in c++?
What is helper in c++?
What are references in c++? What is a local reference?
What is a static element?