I need to implement subSet so it returns a new NavigableSet thatcontains all elements x such that formKey <= x <toKey. Thisis the skeleton provided.
import java.util.*;
public class BSTSet<T extends Comparable<T>>implements NavigableSet<T> {
// the root of the tree
protected TreeNode<T> root;
// number of TreeNodes in the tree
public int size;
public BSTSet() {
root = null;
size = 0;
}
/*
Insert the element d into the Binary Search Tree
*/
@Override
public void add(T e) {
insert(root,e);
}
/* Creates a BST from the given array. To get the BSTthat you
expect, the order of the data should
PayPal Gateway not configured
PayPal Gateway not configured