Introduction
An introduction to searching algorithms, including basic lookup tasks, complex search systems, and the idea of reusable algorithmic solutions.
Introduction to Searching Algorithms
What is a searching algorithm?
A searching algorithm is a reusable solution for finding or checking information. Searching can describe simple lookup tasks or more complex systems such as Google.
Common searching tasks
| Task | What is being searched or checked? |
|---|---|
| Find a substring | Whether one piece of text appears inside another |
| Check a username | Whether a username is already taken |
| Validate a state | Whether a state is valid |
| Locate an array value | Where a value appears in an array |
These tasks look different, but each requires a way to find information or determine whether a condition is true.
A useful way to think about named algorithms
Algorithm names describe reusable solutions to common problems. When a problem involves searching, the appropriate searching algorithm provides a structured way to solve it.
Key idea
Searching is not limited to finding a value in an array. It also includes checking text, usernames, and valid states, as well as supporting complex systems such as Google.