Implement the binarysearchtree class the binarysearchtree


This is Java, not c++, and please do as what requires. Thank you very much! And source code needed is provided below the description.

Binary Search Tree
Implement the BinarySearchTree class. The BinarySearchTree class extends the BinaryTree class which implements the Tree interface. All can be seen here. Your assignment is to implement all of the abstract methods of the BinaryTree class recursively.
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.

Code:
/*
*
* 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;
}
}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Implement the binarysearchtree class the binarysearchtree
Reference No:- TGS02387566

Now Priced at $10 (50% Discount)

Recommended (94%)

Rated (4.6/5)