Compare work as the collection doubles — quick review
An algorithm's efficiency estimates the work it does, and it is stated in terms of the size of the input.
To compare the efficiency of two procedures, count a step, such as a comparison, as a function of the input size. When a row doubles, a linear search's worst case doubles, a binary search's grows by one check, and, from 4 cards on, selection sort's count grows a little more than four times.
Choose the measure of size, such as the number of cards, and the step to count, such as a comparison.
Write the worst-case count for one size.
Double the size and write the worst-case count again.
Compare the new count with the old one to see how the count grows.
Compare the growth of the procedures, not their counts on one small input.
Comparing one small input hides the difference. On 3 cards the two searches make at most 3 and at most 2 comparisons, but on 63 cards they make at most 63 and at most 6. Compare how the counts grow.
A best case can also mislead. A linear search whose target sits on the first card makes one comparison at any size; the worst case, a target absent from the row or first found on the last card, shows the cost of a big row.