SAT / PSAT
SAT / PSAT Prep
History & Social Science
AP World History AP US History AP European History AP Human Geography AP US Government & Politics AP Psychology AP Macroeconomics AP Microeconomics
English
AP English Language & Composition AP English Literature & Composition
Math & Computer Science
AP Calculus AB/BC AP Precalculus AP Statistics AP Computer Science A AP Computer Science Principles
Sciences
AP Biology AP Chemistry AP Environmental Science AP Physics 1 AP Physics 2
World Languages & Arts
AP Spanish Language AP Art History AP Music Theory Start studying →
Unit 3 · Algorithms & Programming Flashcards Cheat Sheet Essentials Visual Review MC Practice FRQ Practice

AP Computer Science Principles Unit 3 Essentials

The must-know terms and core concepts for Unit 3: Algorithms & Programming. Every vocabulary word and idea you need to master.

← Back to Unit 3 hub
Key Concept 1
Programs are built from sequencing, selection, and iteration
Every algorithm is assembled from three foundations: sequencing (running steps in order), selection (conditionals that choose which code runs based on Boolean expressions), and iteration (loops that repeat code). These operate on variables that store values updated by assignment, using arithmetic (including MOD), string, and logical operations. Combining these building blocks is how you develop a working algorithm.
Variables Selection Iteration
Key Concept 2
Lists and procedures manage complexity through abstraction
As programs grow, abstraction keeps them manageable. A list holds many values in one indexed collection that you can traverse and search — with linear search on any list, or the much faster binary search on sorted data. Procedures (with parameters and return values) name and reuse blocks of behavior, and libraries (accessed through an API) share procedures across programs. Abstraction lets you use these pieces without worrying about their internal detail.
Lists & Search Procedures Abstraction
Key Concept 3
Programs use randomness and simulation — and algorithms have limits
Programs can generate random values to add variability and build simulations that model real phenomena more cheaply and safely than real experiments (though only as well as their assumptions). Not all algorithms are equal: algorithmic efficiency describes how run time grows with input size — a key reason binary search beats linear search at scale. And some problems are undecidable: no algorithm can always produce a correct answer, showing that computing has fundamental limits.
Simulation Efficiency Undecidable Problems
Variable
A named location that stores a value which can change as the program runs.
Building Blocks
Assignment
Storing a value in a variable (for example, x ← 5).
Building Blocks
Data abstraction
Managing complexity by hiding detail, such as using a list instead of many variables.
Building Blocks
MOD operator
An operator that returns the remainder of a division (17 MOD 5 = 2).
Building Blocks
String
An ordered sequence of characters; strings can be concatenated (joined).
Building Blocks
Boolean value
A value that is either true or false.
Logic
Relational operator
An operator that compares two values and yields a Boolean (=, ≠, <, >, ≤, ≥).
Logic
Logical operator
AND, OR, or NOT, used to combine or reverse Boolean expressions.
Logic
Conditional (selection)
An if / if-else statement that chooses which code runs based on a condition.
Control
Nested conditional
A conditional placed inside another conditional.
Control
Iteration
Repeating a block of code using a count-controlled or condition-controlled loop.
Control
Algorithm
A finite sequence of step-by-step instructions built from sequencing, selection, and iteration.
Control
List
An ordered collection of elements accessed by index.
Lists
Index
The position of an element within a list.
Lists
Traversal
Visiting each element of a list in order, usually with a loop.
Lists
Linear search
Checking each element of a list in order until the target is found.
Search
Binary search
Repeatedly halving a sorted list to find a target efficiently.
Search
Procedure
A named, reusable group of statements that may take parameters and return a value.
Procedures
Parameter
A variable in a procedure's definition that receives an argument when called.
Procedures
Library / API
A collection of reusable procedures, and the description of how to use them.
Procedures
Random value
A value produced by a generator such as RANDOM(a, b), returning an integer from a to b inclusive.
Programs
Simulation
A program that models a real-world phenomenon.
Programs
Algorithmic efficiency
A measure of how an algorithm's run time grows as the input size grows.
Programs
Undecidable problem
A problem for which no algorithm can always give a correct yes-or-no answer.
Programs