Question: please implement the following methods import java.util.Queue; import java.util.LinkedList; /** * * */ public class BinSrchTree >{ private static class BinNode { private T data;

please implement the following methods
import java.util.Queue; import java.util.LinkedList; /** * * */ public class BinSrchTree
public BinNode(T data, BinNode
public T first(){ } public T last(){ } public T higher(T item){ } public T lower(T item){ } public T ceiling(T item){ } public T floor(T item){ } public T pollFirst(){ } public T pollLast(){ } public int size(){ } public BinSrchTree
In this lab, we will work on adding more operations for BST. Java TreeSet is a balanced binary search tree. In addition to add, remove and search operations as what we have learned in our BinSrch Tree, it has a number of other operations. In this programming exercise, we will expand our BinSrchTree class with more similar operations from TreeSet class. Add the following instance methods to BinSrch Tree class in our unit example JavaBSTLinked and then test them in the driver program: T first() which returns the first (lowest) item currently in the tree I last() which returns the last (highest) item currently in the tree T higher (T item) which returns the least item in the tree strictly greater than the given item, or null if there is no such item T lower (T item) which returns the greatest item in the tree strictly less than the given item, or null if there is no such item I ceiling (T item) which returns the least item in the tree greater than or equal to the given item, or null if there is no such element T floor (T item) which returns the greatest item in the tree less than or equal to the given item, or null if there is no such item I pollFirst() which retrieves and removes the first (lowest) item, or returns null if the tree is empty I polllast() which retrieves and removes the last (highest) item, or returns null if the tree is empty int size () which returns the number of items in the tree (its cardinality) BinSrchTree
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
