Could anyone please explain this answer?
Asked
Active
Viewed 877 times
0
-
1ever heard of polish notation? https://en.wikipedia.org/wiki/Polish_notation – mangusta Oct 11 '19 at 17:27
-
@mangusta My sense is that the OP’s confusion is less about what the notation is and more about how the explanation makes sense given the answer. – templatetypedef Oct 11 '19 at 17:36
1 Answers
1
That explanation looks incorrect to me, even though the final answer looks correct. Let’s begin by taking the expression and fully parenthesizing it to show operator precedence:
A - (B / (C * (D^E)))
Notice that this doesn’t match the parenthesization given in the solution, which I suspect is an error in the answers. From here, we see that the top-level operator is the subtraction. The LHS is just the expression A, and the RHS is the expression B / (C * (D^E)), so we can do a partial conversion:
- A [[ whatever the expression is for B / (C * (D^E)) ]]
That nested expression has division as its top-level operator, so we can expand it like this:
- A / B [[ whatever the expression is for C * (D^E) ]]
Repeating this process gives us the following:
- A / B * C [[ whatever the expression is for D^E ]]
- A / B * C ^ D E
Hope this helps!

templatetypedef
- 362,284
- 104
- 897
- 1,065