Linear Search
Domain: Algorithms
π― Motivation
The simplest search: check each element one by one until you find the target or reach the end. O(n) but works on unsorted data.
π Concrete Example
Search for 7 in [3, 1, 4, 1, 5, 7, 2]: check 3 (no), 1 (no), 4 (no), 1 (no), 5 (no), 7 (yes!). Found at index 5.
π Analogy
Looking for a friend in a crowded MTR station by checking each personβs face one by one. Slow but works even if people are standing in random order.