954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

parenthesis checking...

hi to everyone...

i will make a program about parenthesis checking and my prof said that we will not be using a stack for this.

will you kindly help me to this..

aside from stack can you help me on what to use.?.

zhinokin
Light Poster
26 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

So use a counter.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 
So use a counter.

should i still use an array for this....?..

zhinokin
Light Poster
26 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 
counter += 1*(ch=='(') - 1*(ch==')');

It's cryptic because anything simple is the whole answer on a plate.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You