Java Reference
In-Depth Information
5. Add an iterator to the search tree. Write a class called SearchTreeIterator that has the methods that follow for
iterating over a binary tree. You will also need to modify the tree nodes to store parent references so that the
iterator can properly walk “up” the tree as necessary. (See the Java API Specification for descriptions of each
method.) Here are the methods:
public boolean hasNext()
public E next()
public void remove()
6. Write a program that evaluates numeric expressions using a binary expression tree. A leaf node represents an
operand (a number). A branch node represents an operator; its two subtrees represent its operands.
 
Search WWH ::




Custom Search