Learn in the textbookSearch and Sorting Algorithms
DefinitionLinear search (線形探索法) checks the data from the start, one item at a time, against the target value and stops as soon as it finds a match.
ExplanationIt works on data as it is, even if the data has not been sorted. The number of comparisons depends on where the target sits, and if it is last or missing altogether, every item gets compared. On average it takes about half as many comparisons as there are items.
AnalogyIt is like hunting for a book on an unordered shelf by checking each spine from the left end, one book after another.
Memory hook"Linear" means along a line: you trace it from one end in a single direction.