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.

Answered by Ellie F. Computing tutor

2249 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

What is the difference between an array and a record?


Express the number 208 as a) an 8-bit binary number b) an octal string c) a hexadecimal string


A computer stores floating point numbers of size 1 byte, with 3 bits for the mantissa and 5 bits for the exponent. State what the effects would be on the stored numbers if instead 5 bits were used for the mantissa and 3 bits were used for the exponent.


In Python, write a recursive function that returns the first n Fibonacci numbers.


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy