Answer Posted / hrpynux@gmail.com
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 |
Post New Answer View All Answers
What is the main purpose of c++?
What is the advantage of an external iterator.
How do I start a c++ project?
Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?
Define copy constructor.
Program to check whether a word is a sub-string or not of a string typed
Does c++ have foreach?
What is virtual function? Explain with an example
What programming language should I learn first?
Why c++ is so important?
What is the two main roles of operating system?
How would you use the functions memcpy(), memset(), memmove()?
how to explain our contribution in the project?
What are virtual constructors/destructors?
What is the difference between the functions rand(), random(), srand() and randomize()?