R
rami.mawas
I have implemented an RPN calculator in python but now I would like to
make the stack size fixed. how can I transform the user's RPN
expression from a stack overflow to a computable expression.
For instance, if my stack size is 2 then the some expression can't be
computed but could be transformed as following:
Non computable expression: 1 2 3 + + --> stack size of 3 is needed
Computable expression: 1 2 + 3 + --> stack size of 2 is needed
How can I define a formal way of transforming the non computable
expression to computable one.
My RPN only implements: + - x %
make the stack size fixed. how can I transform the user's RPN
expression from a stack overflow to a computable expression.
For instance, if my stack size is 2 then the some expression can't be
computed but could be transformed as following:
Non computable expression: 1 2 3 + + --> stack size of 3 is needed
Computable expression: 1 2 + 3 + --> stack size of 2 is needed
How can I define a formal way of transforming the non computable
expression to computable one.
My RPN only implements: + - x %