23. Searching

  • For the purposes of this topic, searching is the process of looking for a specified thing in some collection to know if it exists within the collection

  • For example, does a given number exist within an array of numbers?

  • To write an algorithm to solve this problem, all that’s needed is something that says if it’s there or not

    • That’s all that’s required

    • Any algorithm that works would suffice

  • However, the focus here will be on two intuitive ideas that people commonly use in one way or another throughout their lives

    • Linear Search

    • Interpolation Search

      • A specific kind of interpolation search called a binary search will be discussed

  • Throughout this topic

    • The thing being searched for will be referred to as the needle

    • The collection being searched through will be referred to as the haystack

23.3. For Next Time

  • Read Chapter 9 Section 1

    • 7 pages

23.3.1. Playing Code