Searching one by one
Lesson 1 of 20 · Algo.Micro
An algorithm is a precise recipe. The simplest one: look at every item until you find the one you want.
An algorithm is a recipe a machine can follow
Check yourself
It has a clear input (a list of numbers and a target), a finite list of unambiguous steps, and an output. Here: ten cards face up. Where is the 25?
Check yourself
How many looks does linear search need, in the worst case, for 1,000 items?
Do it in the browser: a real algorithms tool, a short mission and instant feedback. No install.
Start this lesson — free