Similar questions 4 more →
Stacks & Queues



Answer & solution
Answer: [80] (no official key was published)
Step through it (12 steps)
After 5 2 * 3 4 + 5 2 the stack is [10,7,5,2]. The next * replaces the top two entries 5,2 by 10, leaving [10,7,10]. The following * replaces 7,10 by 70, leaving [10,70]. Finally + replaces 10,70 by 80, leaving [80]. There are six operand tokens and five binary operators, so a valid complete evaluation must leave exactly one entry. In infix form the expression is (5*2)+((3+4)*(5*2))=10+7*10=80.