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 and why do I have to put the "template" and "typename" keywords?

993


Can I create my own functions in c++?

1047


C is to C++ as 1 is to a) What the heck b) 2 c) 10

1020


Should I learn c++ c?

1006


How const int *ourpointer differs from int const *ourpointer?

1078


How much do c++ programmers make?

1067


What is the use of data hiding?

981


Why c++ is the best language?

1012


What is setiosflags c++?

920


What are features of c++?

1116


What gives the current position of the put pointer?

953


Is c++ still in demand?

1114


What are destructors?

951


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

1407


What is meant by entry controlled loop?

1066