next up previous
Next: Generate infix Up: Assignment 8: Trees Previous: Assignment 8: Trees

Build the expression tree

  1. Copy your Evaluator object into a new directory. If it is not a proper process object, transform it to that structure, using my solutions as a guide.
  2. Type in the Tree class as presented in the book and test it. If you can think of tree helper methods you think you will need, go ahead and write them, testing them as you go.
  3. Modify Evaluator so that instead of returning an integer, it returns an expression tree.
  4. Print the resulting tree in postorder and confirm that it generates the original postfix expression (or possibly an equivalent one).



Allen Downey
Mon Nov 13 09:08:51 EST 2000