Variable High Frequency
A named container in a program that stores a value which can be changed through assignment. Variables have names, data types, and values.
Constant
A named value in a program that cannot be changed during execution. Used for values that should remain fixed, like PI = 3.14159.
Data Type
A classification that specifies what kind of value a variable can hold, such as numbers, Booleans, lists, or strings. Different data types support different operations.
Integer
A whole number (positive, negative, or zero) represented in programming languages using a fixed number of bits. Examples: -5, 0, 42.
String
An ordered sequence of characters. Strings can contain letters, numbers, symbols, and spaces. Usually enclosed in quotation marks in code.
Example: "Hello, World!" is a string with 13 characters.
Boolean
A data type that represents one of only two values: true or false. Named after mathematician George Boole. Used in conditions and logical operations.
List High Frequency
An ordered sequence of elements, where each element is assigned a unique index for reference. Lists can contain multiple values and can grow or shrink in size.
Example: myList ← ["apple", "banana", "cherry"] — index 1 is "apple"
Index
The position of an element within a list or string. In AP CSP pseudocode, indices start at 1 (not 0 like many programming languages).
Expression
A combination of values, variables, operators, or procedure calls that can be evaluated to produce a single value. Expressions are computed to get results.
Assignment
The process of storing a value in a variable. In AP CSP pseudocode, written as: variable ← value. The arrow points to where the value is stored.
Sequencing High Frequency
The application of each step of an algorithm in the order in which the code statements are given. Code runs line by line, top to bottom.
Selection High Frequency
A control structure that determines which parts of an algorithm are executed based on whether a condition is true or false. Implemented using IF/ELSE statements.
Iteration High Frequency
A repeating portion of an algorithm that executes a specified number of times or until a given condition is met. Implemented using loops (REPEAT, FOR EACH).
Procedure High Frequency
A named block of reusable code that performs a specific task and can be called multiple times throughout a program. Also called a function or method in other languages.
Parameter
A variable in a procedure definition that allows it to accept different input values. Parameters make procedures flexible and reusable with different data.
Argument
The actual value passed to a procedure when it is called, which corresponds to the procedure's parameter. Arguments provide the specific data for each call.
Example: In calculateArea(5, 3), the arguments are 5 and 3.
RETURN Statement
A statement that causes a procedure to immediately exit and return a value to the calling statement. The returned value can be used in expressions.
Procedural Abstraction
A programming technique that provides a name for a process and allows a procedure to be used by knowing what it does without needing to know how it works internally.
Modularity
The subdivision of a computer program into separate subprograms or modules to manage complexity. Each module handles one specific aspect of the program's functionality.
Software Library
A collection of pre-written procedures and code that can be reused in creating new programs. Libraries save time by providing tested, ready-to-use functionality.
API (Application Program Interface)
Specifications that define how procedures in a library behave and how they can be used in programs. APIs provide documentation for using external code.
Relational Operators
Symbols used to compare two values. Include: = (equal), ≠ (not equal), > (greater than), < (less than), ≥ (greater than or equal), ≤ (less than or equal).
Logical Operators
Operators used to combine or modify Boolean expressions: AND (both must be true), OR (at least one must be true), NOT (reverses the value).
MOD (Modulus)
An arithmetic operator that returns the remainder when one integer is divided by another. Useful for determining if numbers are even/odd or for cycling through values.
Example: 17 MOD 5 = 2 (17 ÷ 5 = 3 remainder 2)
Nested Conditionals
Conditional statements placed within other conditional statements, allowing for more complex decision-making logic based on multiple conditions.
Infinite Loop
A loop that never terminates because the ending condition will never evaluate to true. Usually a bug, but sometimes intentional in event-driven programs.
Linear Search (Sequential Search) High Frequency
A search algorithm that examines each element in a data set one by one in order until the desired value is found or the end is reached. Works on unsorted data.
Binary Search High Frequency
A search algorithm that starts at the middle of a sorted data set and eliminates half of the remaining data with each iteration until the desired value is found. Much faster than linear search for large sorted lists.
Key requirement: Data must be sorted first!
RANDOM(a, b)
A function that generates and returns a random integer from a to b, inclusive, where each result is equally likely to occur. Used in simulations and games.
Simulation
An abstraction of real-world objects or phenomena that uses varying sets of values to represent changing states for a specific purpose. Simulations can model complex systems without real-world risks or costs.
Algorithmic Efficiency
An estimation of the amount of computational resources (such as time or memory) used by an algorithm, typically expressed as a function of the input size.
Reasonable Time
Algorithms with polynomial efficiency (constant, linear, quadratic, etc.) that can be solved in a practical amount of time even as input grows.
Unreasonable Time
Algorithms with exponential or factorial efficiencies that require impractically long amounts of time to solve as input size increases.
Heuristic
An approach to a problem that produces a solution that is not guaranteed to be optimal but may be used when techniques that always find the perfect solution are impractical.
Decidable Problem
A decision problem (yes/no question) for which an algorithm can be written to produce a correct output for all possible inputs.
Undecidable Problem
A problem for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer for all instances. The Halting Problem is a famous example.