AP Computer Science A Flashcards: Searching Algorithms
Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026
Review key ideas with interactive flashcards. This set includes 10 cards to help you master important concepts.
What is the primary objective when developing code for a linear search?
The primary objective is to search for specific information in a collection and determine the results of executing that search.
Card 1 of 10
All Flashcards (10)
What is the primary objective when developing code for a linear search?
The primary objective is to search for specific information in a collection and determine the results of executing that search.
What are the two possible outcomes of executing a linear search?
The two possible outcomes are that the desired value is found, or that all elements have been checked and the value is not in the collection.
When does a linear search algorithm stop executing?
The search stops when the desired value is found or after all elements in the array or ArrayList have been checked.
From which direction(s) can a linear search begin?
Linear search algorithms can begin the search process from either end of the array or ArrayList.
When searching a 2D array, what must happen before a linear search can be applied to the elements of a row?
Before applying the linear search to the elements, the specific row containing those elements must be accessed first.
Define 'linear search' in the context of searching a collection.
Linear search is a standard algorithm that sequentially inspects every element in a collection until a match for the target value is found or the list ends.
How is a linear search algorithm applied to a 2D array?
When applying a linear search to a 2D array, each row must be accessed, and then a linear search is applied to each individual row.
What is a linear search algorithm?
It is a standard algorithm that checks each element in order until the desired value is found or all elements in the collection have been checked.
What is the fundamental process of a linear search?
The fundamental process is to check each element in a collection sequentially until a match is found.
What is the result of executing a linear search for a value that is not present in an array?
The result is that all elements in the array will have been checked, and the algorithm will conclude that the value was not found.