Sequential search (also called linear search) is an algorithm that checks each element of a list one at a time, in order, until it finds the target value or reaches the end. In AP CSP, it's the baseline you compare against binary search, which is usually faster but requires sorted data (EK AAP-2.P.3).
Sequential search is exactly what it sounds like. You start at the first element of a list and check each one in order, asking "is this the value I'm looking for?" until you either find it or run out of elements. The College Board also calls it linear search, and the two names are interchangeable on the exam.
Its superpower is that it has no requirements. The list can be sorted, unsorted, a total mess, and sequential search still works, because it never skips anything. The tradeoff is speed. In the worst case (target at the end, or not in the list at all), you check every single element. That's why the CED frames it as the comparison point for binary search: EK AAP-2.P.3 says binary search is often more efficient than sequential/linear search when applied to sorted data. Sequential search is the simple, always-works option; binary search is the fast option with a precondition.
Sequential search lives in Unit 3: Algorithms and Programming, specifically Topic 3.11 (Binary Search). Learning objective 3.11.A asks you to determine how many iterations binary search needs and explain its requirements, and you genuinely can't do that without sequential search as your reference point. The whole argument for binary search is "it beats sequential search," so you need to know what sequential search costs. The numbers make it concrete. Searching a sorted list of 1 million elements for a value at position 500,000 takes sequential search about 500,000 comparisons; binary search needs roughly 20, because each step cuts the remaining data in half (EK AAP-2.P.1). But the comparison flips when data is unsorted: binary search requires sorted data (EK AAP-2.P.2), and sorting first is expensive, so for a one-time search of unsorted data, sequential search can actually be the smarter choice. That tradeoff reasoning is exactly the kind of efficiency thinking AP CSP rewards.
Keep studying AP Computer Science Principles Unit 3
Binary Search (Unit 3)
Binary search is the algorithm sequential search gets compared to in every exam question on this topic. Binary search halves the data each step but demands sorted input; sequential search is slower but works on anything. Knowing when each one wins is the actual skill being tested.
Traversing a List (Unit 3)
Sequential search is just list traversal with a purpose. You visit elements one by one (usually with a loop) and stop early if you find the target. If you can write a FOR EACH loop with an IF check inside, you've written a sequential search.
Linear Data Structure (Unit 3)
Sequential search works because lists are linear, meaning elements sit in a definite order with a first, second, third, and so on. The algorithm's "check each one in order" strategy is a direct consequence of that structure.
Algorithm (Unit 3)
Sequential search is one of the cleanest examples of an algorithm in the whole course: a finite, step-by-step procedure with clear inputs and a definite stopping condition. It often shows up as the example when efficiency and algorithm comparison get introduced.
Sequential search shows up in multiple-choice questions, almost always head-to-head with binary search. Expect three question styles. First, counting comparisons: given a list size and a target position, estimate how many checks each algorithm needs (for 1 million sorted elements with the target at position 500,000, that's roughly 500,000 for sequential versus about 20 for binary). Second, choosing the right tool: questions ask which scenario favors binary search (large, sorted, repeatedly-searched data) versus when sequential search could actually outperform it (unsorted data, small lists, or when the target happens to be near the front). Third, the sorting tradeoff: whether it's worth sorting an unsorted list just to enable binary search, or whether one sequential search is cheaper. You won't be asked to write a specific binary search implementation (the CED excludes that), but you do need to reason about iteration counts and requirements, and sequential search is the baseline for all of it.
Sequential search checks every element in order, front to back, and works on any list, sorted or not. Binary search jumps to the middle of a sorted list and eliminates half the remaining data with each comparison. Binary search is usually far faster (about 20 steps for a million elements versus up to a million for sequential), but it completely breaks on unsorted data. One more naming trap: "sequential search" and "linear search" are the same algorithm, not two different ones.
Sequential search (linear search) checks each element of a list one at a time until it finds the target or reaches the end.
It works on any list, sorted or unsorted, which is its biggest advantage over binary search.
Worst case, sequential search checks every element, so a list of n elements can take n comparisons, while binary search on sorted data takes about log₂(n).
Binary search requires sorted data (EK AAP-2.P.2), so for a one-time search of unsorted data, sequential search can be the better choice because sorting first is expensive.
Exam questions usually ask you to compare comparison counts or pick which algorithm fits a scenario, not to write code for either one.
Sequential search is an algorithm that checks each element in a list one by one, in order, until it finds the target value or hits the end of the list. It appears in Unit 3, Topic 3.11, as the comparison point for binary search.
Yes, completely. "Sequential search" and "linear search" are two names for the exact same algorithm, and the CED uses them interchangeably (EK AAP-2.P.3 says "sequential/linear search").
No. Binary search only works on sorted data, so on an unsorted list it either fails or requires an expensive sort first. Sequential search can also win on very small lists or when the target sits near the front. Binary search dominates on large, already-sorted data that gets searched repeatedly.
Sequential search starts at the front and checks every element in order; binary search starts at the middle of a sorted list and eliminates half the data with each comparison. For a sorted list of 1 million elements, sequential search might need up to a million comparisons while binary search needs about 20.
No. Sequential search works on any list because it never skips elements. The sorted-data requirement belongs to binary search (EK AAP-2.P.2), and mixing up which algorithm needs sorting is a classic MCQ trap.