Explain how a stack could be used in the process of evaluating an expression in Reverse Polish notation.

Starting at the left hand side of the expression push values onto stack. Each time operator reached in the expression pop the top two values off the stack and apply the operator to them, then push the new value back onto the stack. When the end of the expression is reached the final value on the stack is the final result.

EF

Related Computing A Level answers

All answers ▸

Given a graph with n nodes and m edges, every edge has a passing cost that can be negative, find the minimum distance between node 1 and every other node


Give two types of management of either hardware or other resources that are performed by an operating system.


What is an ALU?


Write pseudocode for the binary search algorithm and state, with an explanation, it's worst case complexity in big-O notation