Understand the idea
Linear search checks items one by one. Binary search repeatedly narrows a sorted search space. It requires the ordering assumption.
WORKED EXAMPLE
Find 14 in sorted [2,4,6,8,10,12,14,16]. Using lower middle: check 8, then 12, then 14.
Watch it step by step
Step 1 of 4Set
Sorted list has eight values; target is 14.
Choose Play to advance steps automatically.
Read or choose any step
- Set
Sorted list has eight values; target is 14.
- Middle
Check 8; target is larger.
- Narrow
Check 12 in the remaining upper range.
- Find
Check 14; the target is found.
TRY BEFORE CHECKING
Exercises with feedback
MAKE SOMETHING YOU CAN EXPLAIN
Your practical challenge
Trace linear and binary search for 14. Count comparisons and state the midpoint rule.
These ticks are your self-review. They do not automatically assess project quality. Ask an adult or partner to review what you can show.
Use the skill in a new situation
Test a missing target and a one-item list.