/** * This class searches its list for a specified item * by index */ import java.util.List; public class BinarySearch { private List items; /** * This constructor accepts a List of items to be searched. * @param items the list of items we are searching * @throws IllegalArgumentException if the list passed is not sorted */ public BinarySearch(List items) { //throw an IllegalArgumentException if //the list is out of order. this.items = items; } /** * This searches our list and returns the index containing * quarry * @param quarry the item we week * @return the index of the first instance of quarry, * or -1 if quarry is not found. */ public int indexOf(T quarry) { //use bianry search to locate quarry by index //return -1 if it's a wild goose chase. return -1; } public static void main(String[] args) { //TEST YOUR CODE!! } }