title: Evaluate Prefix Expressions
body: <p>Here is the problem:</p>
  
  <p>"An expression is in prefix form when operators are written before their operands.
  Here are some examples of prefix expressions and the values they evaluate to:</p>
  
  <pre><code>        Expression____________________Value_
          12                            12
          + 2   51                      53
          * 5   7                       35
          *  + 16  4        + 3 1       80
  </code></pre>
  
  <p>An expression (such as 12) that begins with an integer is a prefix expression that evaluates to itself. Otherwise, an expression is a prefix expression if it begins with an operator and is followed by two prefix expressions. In this latter case, the value of the expression is recursively computed from the values of its constituent prefix sub-expressions.</p>
  
  <p>Write a program that allows the user to enter prefix expressions in a text field. The program reads the expression, evaluates it, and displays the value in a suitable GUI component. Assume that the user enters expressions that use only positive integers and the two operators + and *. Your program should use a stack to store values of sub-expressions as they are computed, and another stack to store operators that have not yet been applied."</p>
  
  <p>I can't see anyway to solve it using a stack for operators and another for expressions. However, it is very simple to solve with one stack and doing it from reverse.</p>