Computer Science & Engineering 505
Assignment 6

Due: Nov 24, 1999

This assignment should be easy, and I suggest getting it done before the Thanksgiving vacation, since we will be done with Smalltalk and on to functional programming. However, if you are going out of town or are planning on being overstuffed with turkey, you can turn it in by Dec 1 without penalty.

  1. Write a class BinaryTree in Smalltalk that implements implements sorted binary trees, mirroring your Java binary tree from Assignment 5. You do not need to implement this -- a pencil-and-paper solution, with correct semantics and syntax that at least resembles Smalltalk, is fine. (If you have time, though, implementing and testing your classes would increase the educational value of this assignment.) Your binary tree should provide the following methods: Also, evaluating BinaryTree new should produce a correctly initialized empty tree.

    You don't need to include a delete method. Again, you don't need to worry about synchronization issues, and don't need to make your BinaryTree be a subclass of Collection.

  2. Compare Smalltalk's technique for traversing the tree with Java's with respect to flexibility and ease of implementation.