Please assist me on this assignment implement the


Please assist me on this assignment. Implement the BinarySearchTree class. The BinarySearchTree class extends the BinaryTree class which implements the Tree interface. Please see the codes below. Implement all of the abstract methods of the BinaryTree class recursively. Include the main method for the BinarySearchTree class, use recursion in the code and make sure the code produces the correct output.

They are:

  • Insert
  • Iterator (non-recursive)
  • Remove.
  • Search.

Also, implement an Iterator inner class for the BinarySearchTree class. Make sure to have a modified BinarySearchTree.java file with your source code. Do not submit and do not modify the Tree.java or BinaryTree.java files.

/*
 *
 *  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
Basic Computer Science: Please assist me on this assignment implement the
Reference No:- TGS02757723

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)