Reverse Polish

Consider the calculation as follows :

2 ( X + 3 ) Y + 9 \frac{2(X+3)} {Y+9} (where X & Y are variables)

Which of the following represents the correct Reverse Polish notation for that calculation :

  • A 2 X * 3 + Y / 9 +
  • B 2 X 3 + * Y 9 + /
  • C 2 X + 3 * Y 9 + /

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Tony Flury
Sep 19, 2015

You can use the Shunting yard algorithm to get the answer :

which is : 2 X 3 + * Y 9 + /

If you are in doubt :

2 X * 3 + Y / 9 + : is 3 X + 2 Y + 9 \frac { 3X+2 }{Y} + 9 and 2 X + 3 * Y 9 + / is ( 2 + X ) 3 Y + 9 \frac {(2 + X)*3}{Y+9}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...