36. A stack has been implemented to help calculate numericalexpressions +, -, and each act on the Top 2elements of the stack inthe same way.
Example: the operation ( – ) causes (Second POP – First POP) tobe pushed into the stack and similarly for the other operations
What is the appropriate order of operations to finish with2+3*4-5=9 on the top of the stack?
Push(2), Push(3), *,Push(4),*,Push(5)-
Push(2), Push(3),Push(4),*,+, Push(5)-
Push(5), Push(4),Push(3),*,Push(2),+,-
Push(2), Push(3),Push(4),Push(5),-,*,+
37. A stack S, a queue q, and a max value priority queue p, eachhave 3 in them. Next s.push(2), q.push(2), and p.push(2) areexcecuted.
What is the triple (s.pop(), q.pop(), p.pop())?
(2,2,2,) (2,3,3) (3,3,3) (2,2,3)
38.
OR
OR