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 |
How do I tokenize a string in c++?
What is meant by forward referencing and when should it be used?
How is static data member similar to a global variable?
What is new in c++?
Explain selection sorting?
Describe public access specifiers?
Explain what data encapsulation is in c++?
What is double in c++?
int main() { int i ,a[i]; i = 0; a[i] = 10; cout<< a[i] << endl; return 0; } What will be output of this program?
What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class B { float f; char c; int a; }
Can a list of string be stored within a two dimensional array?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?