/java_sequential-binary_search

A comparison on the run time between a sequential and binary search

java_sequential-binary_search

A comparison on the run time between a sequential and binary search

A small java script to read in a text file that contains two arrays, a data and a query. The query is searched against the array using first a sequential search and then a binary search. Each method is timed, the output of each is shown along with the time it took to parse each query through the data array. The text file is read in through user command.

The format of the text files is as follows, where the first number on the first line is how many rows after the initial is in the data array, and the second number is how many rows following that which are in the query array:
5 2
95
62
166
113
182
94
82