Computer Science Principles · AP CSP Big Idea 3: Algorithms and Programming · 18 min read · Updated 2026-05-11
Algorithms and Programming — AP Computer Science Principles
AP Computer Science Principles · AP CSP Big Idea 3: Algorithms and Programming · 18 min read
1. Core Fundamentals: Algorithms and Variables★☆☆☆☆⏱ 3 min
An algorithm is a finite, step-by-step set of unambiguous instructions for solving a problem. Unlike informal instructions like baking recipes, valid algorithms always terminate after a fixed number of steps. Programming is the process of translating algorithms into a structured format computers can execute.
2. Mathematical and Boolean Expressions★★☆☆☆⏱ 4 min
Expressions combine variables, values, and operators to produce a single new value. Two core types are tested on the AP CSP exam: mathematical expressions (produce numbers) and Boolean expressions (produce `true`/`false`).
Mathematical expressions follow standard PEMDAS order of operations: Parentheses → Exponents → Multiplication/Division/Modulus → Addition/Subtraction. The modulus operator `MOD` returns the remainder of integer division.
Boolean expressions evaluate to `true` or `false`, forming the basis of conditional logic. They use two categories of operators:
Logical operators: combine multiple Boolean values: `AND` (true only if both inputs true), `OR` (true if at least one input true), `NOT` (reverses input value)
3. Control Flow and Lists★★★☆☆⏱ 5 min
All algorithms are built from three core control structures that define the order code executes: sequence (default top-to-bottom order), selection (run code based on conditions), and iteration (repeat code multiple times).
4. Procedural Abstraction★★★☆☆⏱ 3 min
Abstraction hides unnecessary complex implementation details, exposing only the functionality a user needs. Procedural abstraction (also called function abstraction) organizes code into reusable procedures (named blocks of code) that perform a specific task.
Procedures can take input values called parameters, and can return a single output value