AP Computer Science A Flashcards: Implementing Selection and Iteration 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.
Why is determining the result of an algorithm a key skill?
Determining the result is crucial for verifying that the algorithm works correctly and for understanding its behavior with different inputs.
Card 1 of 10
All Flashcards (10)
Why is determining the result of an algorithm a key skill?
Determining the result is crucial for verifying that the algorithm works correctly and for understanding its behavior with different inputs.
What two values must be calculated by an algorithm to compute an average?
To compute an average, an algorithm must first determine the sum of all values and the total count of those values.
To find the smallest value in a list of positive numbers, a variable `min_val` is initialized. What is a common and safe initial value for `min_val`?
A safe initial value would be the first number in the list or a very large number that is guaranteed to be greater than any value in the list.
What is the standard algorithm to determine if an integer is evenly divisible by another?
A standard algorithm checks if an integer is evenly divisible by another by determining if the remainder of their division is zero.
What is the core logic of a standard algorithm for finding a minimum or maximum value?
The algorithm iterates through a sequence of values, continuously tracking and updating the smallest or largest value encountered so far.
How does a standard algorithm identify the individual digits in an integer?
An algorithm can isolate individual digits by repeatedly using the modulo operator to get the last digit and integer division to remove it.
An algorithm is developed to find the sum of all even numbers from 1 to 100. What two standard algorithm types are being combined?
This combines an algorithm for checking divisibility (to identify even numbers) with an algorithm for computing a sum.
What is meant by developing code for algorithms 'without data structures' in this context?
It refers to creating algorithms using fundamental programming logic like loops and conditionals, rather than relying on complex, pre-built data structures.
If you need to count how many students in a class scored above 90%, which type of standard algorithm would you use?
You would use an algorithm designed to determine the frequency with which a specific criterion (scoring above 90%) is met.
Define the purpose of a frequency-determining algorithm.
Its purpose is to iterate through data and count the number of times a specific condition is true or a certain value appears.