Two labs ago, you saw a few different approaches to the important problem of searching: given a list of numbers, how would you find a certain number that you are interested in? A lot of people are interested in this problem; a lot of companies have people whose jobs are to sift through data and create algorithms to grab information sought by users as quickly as possible. For example, Google has an entire building (or twenty) of people dedicated to arranging the vast amount of information available on the Internet in various interesting ways, solely so that the search engine can return answers quickly. (In a future lab, you will be implementing a very basic search engine.) Microsoft and Apple create software that organizes the files on a computer in a certain way, so as to make it easier for the computer to quickly find files the user may need or use.

The very first algorithm that we saw for searching was the "walking" approach: we "walk" through the list until we find the number that we want. What kind of runtime would this algorithm have, in the worst-case: would it be constant, linear, or neither? This question may help: if you were having a particularly bad day and the number you wanted was always at the end of the list, how long would it take to find the number if, say, the list was 20 elements long? 200 elements long? 2000 elements long?

Constant Time
Linear Time
Neither