In a stack s, TIM is equivalent to s.push(s.pop() * s.pop()) and SUM is equivalent to s.push(s.pop() + s.pop()). What will the following stack machine evaluate the operations as?
1
2
3
4
5
6
7
8
9
PUSH 1
PUSH 2
PUSH 3
PUSH 4
PUSH 5
SUM
TIM
SUM
TIM
Your answer seems reasonable.
Find out if you're right!