PrepGo

AP Computer Science A Flashcards: Recursive Searching and Sorting

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 a primary skill related to executing recursive algorithms on strings or collections?
A primary skill is the ability to determine the final result of executing recursive algorithms that use strings or collections.
Card 1 of 10

All Flashcards (10)

What is a primary skill related to executing recursive algorithms on strings or collections?
A primary skill is the ability to determine the final result of executing recursive algorithms that use strings or collections.
When analyzing a binary search, what is the key outcome to determine for each iteration?
For each iteration, one must determine which half of the array or ArrayList is eliminated and which half remains for the next recursive search.
Describe the fundamental process of a binary search.
Binary search starts at the middle of a sorted array or ArrayList and eliminates half of the collection in each recursive call until the value is found or all elements are eliminated.
What is a critical requirement for an array or ArrayList before performing a binary search?
The array or ArrayList must be sorted before the binary search algorithm can be executed correctly.
What is the main objective when tracing the execution of a merge sort algorithm?
The main objective is to determine the result of each iteration, observing how the collection is divided and then merged back together in sorted order.
What do binary search and merge sort have in common?
Both are recursive algorithms that can be used on arrays or ArrayLists.
On which data structures can recursion be used for traversal according to the text?
Recursion can be used to traverse String objects, arrays, and ArrayList objects.
When does a binary search stop?
The binary search algorithm stops when the desired value is found or when all elements have been eliminated from the search space.
What is merge sort?
Merge sort is a recursive sorting algorithm that can be used to sort elements in an array or ArrayList.
How does binary search reduce the search space with each step?
In each recursive call, binary search eliminates half of the remaining elements from consideration.