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
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()
Step by Step Solution
3.46 Rating (166 Votes )
There are 3 Steps involved in it
template class BSTIterator BSTNode mcurNode stdstack mrecurseIter public BSTIterator BSTNode bin... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
2079_61d6ac3452e0b_861004.pdf
180 KBs PDF File
2079_61d6ac3452e0b_861004.docx
120 KBs Word File
