this is suppose to be infix to postfix converter
ramyking 0 Newbie Poster
Recommended Answers
Jump to PostThe main problem is that all your code is in one function, making it difficult to reason about. You need to design your code around the limitations of your brain.
Also, you end up with an empty stack because you never check if your stack is empty.
Jump to PostIt doesn't have data in it. What makes you say it has data in it? If it had data in it, the exception wouldn't be thrown.
I don't see any place in your code where you check to see if the stack has data in it.
Jump to PostYou can't peek if you have an empty stack. (Can you? Oh god please tell me it doesn't return null.)
Jump to PostWhy don't you try reasoning about what your code is doing and figure it out yourself.
Jump to PostOh, but you do have stack.Count. I hope.
All 20 Replies
ramyking 0 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
ramyking 0 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
ramyking 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
ramyking 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
ramyking 0 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
ramyking 0 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
ramyking 0 Newbie Poster
ramyking 0 Newbie Poster
harishan 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
أحمد_9 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
أحمد_9 0 Newbie Poster
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.