patternModerate
What is the significance of reverse polish notation?
Viewed 0 times
significancethepolishreversewhatnotation
Problem
I teach computing to 18 year olds. After having reverse polish notation (RPN) explained to them, one asked why is it significant enough to be in the public exam. I explained the historical significance of '70s calculators, but this failed to really address the issue.
So, are there any modern practical or theoretical applications of RPN?
So, are there any modern practical or theoretical applications of RPN?
Solution
I've used RPN several times for rapid prototyping, e.g. of programs that have to read and interpret a user-supplied mathematical expression.
Whereas regular mathematical notation would require at least a recursive parser (think brackets, operator order, etc...), an RPN parser is basically a stack with a
This is, however, usually for rapid prototyping and for convenience. I would never assume that a user can, or wants to, understand RPN.
Whereas regular mathematical notation would require at least a recursive parser (think brackets, operator order, etc...), an RPN parser is basically a stack with a
switch-like statement. I guess it's this combination of simplicity and expressive power that led HP to use it initially.This is, however, usually for rapid prototyping and for convenience. I would never assume that a user can, or wants to, understand RPN.
Context
StackExchange Computer Science Q#4666, answer score: 11
Revisions (0)
No revisions yet.