In this assignment you will be implementing and testing both the Linear Search and Binary Search algorithms that we dicscussed in class.
You will also be writing a driver to test the search algorithms and you will be measuring the test times of each search.
You will write the TestTimes.java class which will implement the
TestTimesInterface
, The interface may be downloaded from
here
.
The TestTimes class will contain an array of 10 long values and a counter of how many
values have been added using addTestTime(long testTime). Every time a new test time is
added, the counter is incremented.
You will write the LinearSearch.java class which will inherit from
TestTimes.java and implement the
SearchInterface
using a linear search algorithm. The interface may be downloaded from
here
.
You can read more about Linear Search here .
You will write the BinarySearch.java class which will inherit from
TestTimes.java and implement the
SearchInterface
using a binary search algorithm. The interface may be downloaded from
here
.
You can read more about Binary Search here .
You will write the SearchDriver.java class to test your implementations of the above classes.
The SearchDriver.java will implement the
SearchDriverInterface
. The interface may be downloaded from
here
.
Please note that, in addition to implementing the DriverInterface, you are also required to write
your own public static main(String[] args) method in SearchDriver.java that tests all of
your classes and methods before submitting your assignment.
Please submit the completed assignment in your zyBooks , in the Homework 1 Chapter.