i am new here and i have this Q to solve it plz help me
Using class stack, write a program to read an expression and checks if the symbols : the parentheses ( ), square brackets [ ] are balanced or not. For example :
(a+b-[c+d)] is not balanced correctly.
(a+b-[c+d]) is balanced
:cry:
moon_light 0 Newbie Poster
Recommended Answers
Jump to PostThat's easy. Stacks are FILO so if you pop a parenthesis off, then at the oppposite position (the last) would have to be a parenthesis. Show a little effort and I can help more.
Jump to Postthank u for ur replayies,,,,
i've already write the stack class ,but i am confusing in writing the code i need someone who explain how to write it because i don't know how to write it,,,plzLet me see your stack class
Jump to PostAstronox has given a good guideline, if you have your stack class working as expected I don't see what the problem is.
Forget c++, this is java.
All 9 Replies
Lord Soth 4 Posting Whiz in Training
server_crash 64 Postaholic
moon_light 0 Newbie Poster

iamthwee
moon_light 0 Newbie Poster
moon_light 0 Newbie Poster
AstroNox 0 Junior Poster in Training
moon_light 0 Newbie Poster

iamthwee
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.