Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tyler Pflueger
8,089 PointsInfix to Postfix with integer numbers question?
I wrote most of the code to parse and convert infix to postfix. The only trouble I'm having is it only converts it for single digits. I'm trying to group the larger numbers with some type of token so when I do want to solve it, I can easily just find the numbers. Any help would be great.
1 Answer
Gunjeet Hattar
14,483 PointsHi Tyler,
Could you tell us a little more of the background logic you implemented?
Of what i can assume is that you might have created a String buffer and an Integer buffer to read through the given input
Then a priority level stack that searches for *, +, / and - pushes and pops them based on a simple logic.
Tyler Pflueger
8,089 PointsTyler Pflueger
8,089 PointsSorry that I never got back to you. I realized that I didn't take out the spaces between the expression so I kept killing all my checks. I was able to get it to work when I took the spaces out so that I could tell if the numbers were larger than single digit.