Add an iterator to the search tree. Write a class called SearchTreeIterator that has the methods that

Question:

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()
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: