Algorithms and Programming
Algorithms transform state through sequences, decisions, repetition, collections, and procedures. AP pseudocode provides a common language for tracing those transformations.
- Exam weight
- 30–35% of multiple choice
- Topics
- 18
Introduction
Algorithms transform state through sequences, decisions, repetition, collections, and procedures. AP pseudocode provides a common language for tracing those transformations.
For every algorithm, identify the current state, the next operation, and the invariant that remains true. Lists use 1-based indexing, `RANDOM(a, b)` includes both endpoints, and procedure calls create local parameter bindings. Efficiency and computability ask different questions: how work grows versus whether a universal algorithm can exist.
Variables and Assignments
What exactly changes when an assignment statement runs?
The right side is evaluated with the current state, and its resulting value replaces the value stored under the variable named on the left.