public class Driver extends java.lang.Object implements DriverInterface
| Modifier and Type | Field and Description |
|---|---|
private static int[] |
listOfNumbers |
private static int |
MAX_NUM_OF_INTEGERS |
private static int[] |
targets |
| Constructor and Description |
|---|
Driver() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getListOfNumbers()
This method will generate and return a sorted array of
int values
starting at 1 and ending at 10,000,000. |
int[] |
getTargets()
This method will return an
int array containing the following values:
500
10,000
100,000
1,000,000
5,000,000
7,500,000
10,000,000
|
TestTimes |
runBinarySearch(int[] listOfNumbers,
int target,
int numberOfTimes)
This method should create an instance of the
BinarySearch.java class and
run the search for the specified target in the listOfNumbers
a total of numberOfTimes. |
TestTimes |
runLinearSearch(int[] listOfNumbers,
int target,
int numberOfTimes)
This method should create an instance of the
LinearSearch.java class and
run the search for the specified target in the listOfNumbers
a total of numberOfTimes. |
private static final int MAX_NUM_OF_INTEGERS
private static int[] targets
private static int[] listOfNumbers
public int[] getListOfNumbers()
DriverInterfaceint values
starting at 1 and ending at 10,000,000.getListOfNumbers in interface DriverInterfaceint array containing the numbers from 1 to 10,000,000.public int[] getTargets()
DriverInterfaceint array containing the following values:
getTargets in interface DriverInterfaceint array containing the values specified above.public TestTimes runLinearSearch(int[] listOfNumbers, int target, int numberOfTimes)
DriverInterfaceLinearSearch.java class and
run the search for the specified target in the listOfNumbers
a total of numberOfTimes.runLinearSearch in interface DriverInterfacelistOfNumbers - An int array containing the numbers to search through.target - The number we will search for.numberOfTimes - The number of times to conduct the search.TestTimes class that was used to save the
measured test times for the linear searches performed.public TestTimes runBinarySearch(int[] listOfNumbers, int target, int numberOfTimes)
DriverInterfaceBinarySearch.java class and
run the search for the specified target in the listOfNumbers
a total of numberOfTimes.runBinarySearch in interface DriverInterfacelistOfNumbers - An int array containing the numbers to search through.target - The number we will search for.numberOfTimes - The number of times to conduct the search.TestTimes class that was used to save the
measured test times for the binary searches performed.