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 function to call to turn an ascii string into a long?
How would you represent an error detected during constructor of an object?
What are the stages in the development cycle?
what is the behaviour of C and C++ compiler for the below statements. int *p; p = malloc(100); Is the behaviour same ? or different ?
Where must the declaration of a friend function appear?
What is the difference between passing by reference and passing a reference?
How many storage classes are available in C++?
Write a program which uses Command Line Arguments
Under what conditions is multiple inheritance not recommended?
If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?
What are the advantages of c++?
Difference between pointer to constant vs. Pointer constant