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
Answered by Ellie F. Computing tutor

3045 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Why indentation is important in Python and what is the scope of a global variable?


Describe Round Robin Scheduling


What is the time complexity of Bubble Sort?


Given an ordered array of integers "V" and a integer "Sum", write a function that would return "true" if it finds two numbers in V that add up to Sum, and "false" otherwise.


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–2025

Terms & Conditions|Privacy Policy
Cookie Preferences