Question: Please assist on this assignment. In java, implement the BinarySearchTree class. The BinarySearchTree class extends the BinaryTree class which implements the Tree interface. The assignment

Please assist on this assignment. In java, implement the BinarySearchTree class. The BinarySearchTree class extends the BinaryTree class which implements the Tree interface. The assignment is to implement all of the abstract methods of the BinaryTree class recursively. Please incude main method in BinarySearchTree class, use recursion in the code, and make sure the code produces the output.

They are:

Insert.

Iterator (non-recursive).

Remove.

Search.

You must also implement an Iterator inner class for the BinarySearchTree class. You must submit a modified BinarySearchTree.java file with your source code.

Do not submit and do not modify the Tree.java or BinaryTree.java files. Please see the codes below for this assignment.

/* * * Tree.java * */ public interface Tree extends Iterable { void insert(E data); void remove(E key); boolean search(E key); } /* * * BinaryTree.java * */ public abstract class BinaryTree implements Tree { protected class Node { protected Node(T data) { this.data = data; } protected T data; protected Node left; protected Node right; } protected Node root; } /* * * BinarySearchTree.java * */ import java.util.Iterator; public class BinarySearchTree> extends BinaryTree { public void insert(E data) { return; } public Iterator iterator() { return null; } public void remove(E key) { return; } public boolean search(E key) { return false; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!