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

What is implicit pointer in c++?

1032


Do you know what are pure virtual functions?

1105


How can you say that a template is better than a base class?

1025


How do I use turbo c++?

938


Why is c++ considered difficult?

1094


How can you quickly find the number of elements stored in a static array?

1054


Explain what is oop?

1008


Can we inherit constructor in c++?

1021


What is buffering in c++?

1019


Differentiate between a constructor and a destructor in c++.

968


What is the use of class in c++?

1004


When we use Abstract Class and when we use Interface?where we will implement in real time?

2134


Explain the properties and principles of oop.

960


Can a program run without main function?

1090


How do you flush a buffer in c++?

1057