How can I solve an infix notation without converting it to any other notation?
I am trying to write a program that will solve an infix notation problem without converting to any other notation.
I have three data structures(1 for operands, 1 for operators, and 1 which contains the infix notation) which can perform push,pop,enQueue,deQueue.
I als开发者_如何学编程o have methods for checking:
- performing the operation
- checking what the item we request is (isOperand, isOperator, isRightparenthesis, isLeftparenthesis)
- checking which checks precedence of object
How can I solve the infix notation without 1st converting to any other format?
note: parenthesis can be added, and assume notation is always proper with no errors. I am having trouble determining the algorithm.Thank you.
Is this useful?
精彩评论