My code is able to compile and run, however the process returns -1. I have drawn out various test cases manually and believes it works, so I am not sure which part of my logic is wrong.
I ask the user for a infix exp., and in2PreLL will
- reverse the infix exp.
- insert it into the front of Linked List
inExpLLor Stacksbased on the switch-case statements - Finally, I reverse the entire
inExpLLto get the prefix exp.
This code assumes:
- input string consists only positive integer numbers
- Only operators are + - * / ( )
I entered the input of (1+2)+(3-4), expecting a prefix exp. of ++12-34 when I draw out the process manually. However, when I run the code, it gives me Process returned -1 (0xFFFFFFFF)
EDIT: I have debugged my code and it works now! Thanks for the suggestions everyone!
insertNode()is missing.