ExpressionTree class given in
Program 9.25
and
Program 9.26.
The source code for the main method is available here.
The input is a reverse-Polish expression of the following form:
The expression may contain only single-digit integers,
single-letter variables,
the binary operators
+, *, *, and /.
The output is the same expression converted to infix notation.
For example, the input a b c + * will cause the program
to compute and print ((a)*((b)+(c))).
(Remember to terminate your input with Control-D).