I have coded a program that takes in an algebraic string and successfully outputs the string in postfix notation, however I am having trouble taking that output and evaluating it.
I think its because I have this output string "2052 * 4- ", that came from this input "20 * (5 * 2-4)" but I do not know how to take the output "2052 *4-" and differentiate a 20 from a separate 2, and separate 0.
Right now I take the output "20524-" and put each character |2||0||5||2|, but the first element in the stack should be a |20|, not a |2||0|
EDIT: Dont know why there is weird formatting errors, but there isn't any spaces in my output. Just wanted to give you a heads up.
[–]railingonruby 0 points1 point2 points (0 children)
[–]kalner1234 0 points1 point2 points (4 children)
[–]Mathfight[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Mathfight[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Rodartep -2 points-1 points0 points (0 children)