cover picture cover picture


Homework 1

CMP 338: Data Structures & Algorithms
Lehman College, City University of New York
Spring 2023


This Homework Is Due By 11:55 PM on Sunday February 12, 2023

Overview

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.

Details

  1. TestTimes zyLab

    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.

  2. LinearSearch zyLab

    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 .

  3. BinarySearch zyLab

    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 .

  4. SearchDriver zyLab

    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.