Skip navigation.

CS 135 Programming Logic

Urn World Tutorial

Chapter 9: Searching

We will extend the search program from the previous chapter. The main point of this chapter is to convince you that if you need to repetitively search an array, then it may be worth the effort to sort the array first.

  1. Searching an unsorted array
  2. Timing a linear search of an unsorted array
  3. Linear search a sorted array
  4. Binary search a sorted array
  5. Summary Algorithms
  6. How fast are they?
  7. Problems