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
How would you use the functions memcpy(), memset(), memmove()?
In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that
What is the type of 'this' pointer? When does it get created?
How can we access protected and private members of a class?
Why do we use iterators?
What is std namespace in c++?
What do you mean by function overriding & function overloading in c++?
Why do we use the using declaration?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
What would happen on forgetting [], while deallocating an array through new?
What is null pointer and void pointer and what is their use?
What is null c++?
What is an undefined behavior and sequence points
What is a multiset c++?
How do pointers work?