Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Check for Balanced Parentheses using Stack?

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


Please Help Members By Posting Answers For Below Questions

Where can I run c++ program?

1050


what Is DCS ? what i will get benefit when i did?

2343


What is the function to call to turn an ascii string into a long?

1040


How important is c++?

966


What is vectorial capacity?

1154


How many ways can a variable be initialized into in C++?

1005


Is arr and &arr are same expression for an array?

1042


What is a class template?

1071


A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.

2169


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3830


What is constructor c++?

1104


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

969


What is a down cast?

1096


What is the most powerful coding language?

1038


What is the difference between the functions rand(), random(), srand() and randomize()?

1261