Tuesday, November 22, 2011


HW 4.3

modify what you have prev.

make a generic BinaryTree class. each Node's element will be Comparable. (The plan is that the element we will store in each node will be a CharFreq.)

implement the following 2 methods:
1) join(t1, t2), in which a new tree will be returned with t1 and t2 as the subtrees.
2) Binary Trees (or BTNodes) should be Comparable. so we will have compareTo. it will be based on the compareTo of the element contained in the node at the top of the respective trees.

class BinaryTree<T>:
BinaryTree left, right
T element

1 comment:

  1. Can you post up another Lecture 17 PowerPoint? The one we have available is not working. You said you were going to post it up and I do not see it

    ReplyDelete