previous | index | next

Searching the Sorted Database

Q: If you start at the beginning of the list, how many titles must you look at to determine that Batman is not in the database?

A: 5 titles

Q: How many titles must you look at to determine that Unbearable Lightness of Being is not in the database?

A: All of them

The problem is that we are sequentially searching the list.

"Sequentially" means "Starting at the beginning of the alphabet and searching in order from there."

Q: If there are n titles on the list, what is the efficiency of a sequential search? (constant, linear, polynomial, exponential)

A:


previous | index | next