Infix to Postfix with function support

后端 未结 5 874
无人及你
无人及你 2021-01-15 21:34

There are many algorithms to convert infix to postfix all over the web. But my question is how to make that to support functions? For example sin(x+y)*z.

I will appr

5条回答
  •  礼貌的吻别
    2021-01-15 22:17

    The code you'll have to work out yourself. Using your specific case as an example might help get you started; the postfix form of sin(x + y) * z would be:

    x y + sin z *

    Note that in this one example some operations operation on two values (+ and *), and others one (sin)

提交回复
热议问题