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 does throwing and catching exceptions differ from using setjmp and longjmp?
What do you mean by pure virtual functions in C++? Give an example?
What is the difference between "calloc" and "malloc"?
Write a C++ program to sort digits of all the 4 digit number and display the sorted 4 digit number
What is a memory leak c++?
what is the behaviour of C and C++ compiler for the below statements. int *p; p = malloc(100); Is the behaviour same ? or different ?
How many types of scopes are there in c++?
Define copy constructor.
Write my own zero-argument manipulator that should work same as hex?
What is a node class in c++?
What is the basic structure of c++ program?
write a programme to get a character and thier ASCII value