开发者

How can I solve an infix notation without converting it to any other notation?

开发者 https://www.devze.com 2023-01-29 04:20 出处:网络
I am trying to write a program that will solve an infix notation problem without converting 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消