CS 201: Data Structures

Searching: three algorithms and their running times

Hand in all .java files (including mine) plus searchreport.pdf

Work with a partner. If you have a specific partner you want to work with, let me know by Thursday at noon. Otherwise I will assign you a partner.

Goals

Relevant code

Background

In class on Feb 13, we discussed the search problem in general, and looked at the two most common and simplest search algorithms: linear search and binary search.

For this assignment, you'll implement some search algorithms based on a given interface, and then you'll time your implementations to see whether they perform as you expect them to.

Important note: The Java standard library contains many implementations of search algorithms. For example, ArrayList includes an method called indexOf, which performs a linear search on the ArrayList contents. For this assignment, you'll be writing your own implementations of various algorithms to help you understand how they work. So for example, we'll use ArrayLists to store items sometimes, but we will not search using indexOf. Once you understand the algorithms, we'll talk about how to use the built-in versions in Java in your future software development.

What to do

A little help

And of course...

Start early(!), ask questions(!!), and have fun(!!!).