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 the main purpose of c++?

1065


What is the advantage of an external iterator.

1049


How do I start a c++ project?

1083


Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?

1084


Define copy constructor.

1120


Program to check whether a word is a sub-string or not of a string typed

2039


Does c++ have foreach?

1068


What is virtual function? Explain with an example

1102


What programming language should I learn first?

1104


Why c++ is so important?

1083


What is the two main roles of operating system?

1043


How would you use the functions memcpy(), memset(), memmove()?

1098


how to explain our contribution in the project?

3706


What are virtual constructors/destructors?

1028


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

1293