Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Infix to Reverse Polish notation

  1. Feb 28, 2012 #1
    I have to convert..

    X=A+((B+C)*D)-E

    to reverse polish notation

    I think it's...

    BC+D*A+E-

    Is this correct?
     
  2. jcsd
  3. Feb 28, 2012 #2

    jhae2.718

    User Avatar
    Gold Member

    Looks right to me.
     
  4. Feb 28, 2012 #3

    jtbell

    User Avatar

    Staff: Mentor

    Yes, that's one way to do it (verified on my HP calculator that uses RPN).

    There are other ways, of course. For example, there's one that has the numbers in the sequence that they appear in the original infix expression. Can you figure that one out? It might be useful if you have to write a program that converts infix to RPN.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Infix to Reverse Polish notation
  1. Reverse the number (Replies: 0)

  2. C++: Postfix to Infix (Replies: 0)

  3. JQuery notation (Replies: 1)

  4. O notation (Replies: 1)

Loading...