Zebra0.com

cpp searchSearching an Array

Searching an Array

Learn C++ in step-by-step lessons.

Searching an Array

Searching generally means finding one particular item in a list. If you are looking for everyone who worked overtime, or all items that need to be reordered, this is referred to as an exception report, not a search.

An exception report is straight forward: loop through every item: if it matches the criteria, print it out.


Goals:

Objectives:

Please study the material at each of the links below.

  1. We use a spreadsheet to demonstrate searching. We use a spreadsheet to demonstrate searching.
  2. Sequential search
  3. The sequential search code
  4. A Binary Search
  5. A number guessing game
GlossaryGlossary for search lesson
Full Glossary