© 1981 by British Computer Society
A comment on the evaluation of Polish postfix expressions
Department of Computer Science, University of Illinois at Urbana-Champaign, Urbana, USA
From its obscure beginnings in the 1950s, the evaluation of the Polish postfix form of arithmetic expressions has been the ne plus ultra of programming examples requiring a push down stack. In this note, which has primarily pedagogical interest, I respond to a suggestion by Deshowitz (1980) that recursion ought to yield a reasonable algorithm without a stack. Of course, the general techniques of Chandra (1973, Theorem 2.19) or Mayoh (1972) could be applied to the usual stack algorithm to eliminate the stack in favour of recursion. That is an unsatisfying approach, however, because it requires a very powerful tool to resolve an elementary problem and because it requires an unnecessary understanding of the stack mechanism. Here a different tack is pursued, one that yields an extremely simple and elegant recursive algorithm almost directly from the definition of Polish postfix.
Received January 1981.
* Department of Computer Science, University of Illinois at Urbana-Champaign, Urbana, Illinois 61801, USA