1/24
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Array (Java)
An object that stores a fixed number of values of the same type; its length cannot change after creation.
Data set
A collection of related data values that are processed together (often modeled with an array or ArrayList in AP CSA).
Data minimization
Ethical practice of collecting/storing only the data you actually need to accomplish a task, reducing privacy risk.
Off-by-one error
A bug caused by incorrect indexing or loop bounds that shifts positions by 1 (e.g., attaching the wrong score to the wrong student).
Array index
The position used to access an array element; starts at 0 and goes up to length − 1.
Array length (.length)
A public field on arrays that gives the number of elements; different from String.length().
Array initializer list
A syntax to create an array with known values (e.g., int[] a = {1,2,3};), which also sets the length automatically.
Default array values
Values Java assigns upon creation: 0 (int), 0.0 (double), false (boolean), null (object references).
ArrayIndexOutOfBoundsException
Exception thrown when code accesses an index outside the valid range (0 to length − 1).
Null reference (in object arrays)
An array slot that holds null instead of an object; calling a method on it causes a NullPointerException.
NullPointerException
Exception thrown when code tries to use an object reference that is null (e.g., calling .equals on a null element).
Scope limiting (privacy practice)
Keeping an array variable less accessible (e.g., private in a class) to reduce unintended reads/updates of sensitive data.
Defensive copy (of an array)
Returning a copy of an internal array instead of the original to prevent outside code from mutating internal state.
Fairness and bias (in dataset processing)
The risk that an algorithm over arrays can produce misleading or harmful outcomes due to under-represented groups, poor assumptions, or inappropriate filtering.
Outlier
An extreme data value that can distort summaries like averages; removing outliers without care can remove valid important cases.
Sentinel value
A special placeholder (e.g., -1) used to represent missing/unknown data; risky if it could also be a valid value.
Summary statistics
Common dataset outputs such as sum, count, average, minimum, and maximum, computed by traversing the array.
Empty array handling
Designing code to correctly handle length == 0 (e.g., avoid dividing by 0 when computing an average).
Integer division (Java)
When both operands are int, division truncates the decimal; casting to double before dividing avoids this.
Traversal (array)
Visiting array elements (usually with a loop) to read, compute with, or update values.
Index-based for loop traversal
Traversal using an index i (for i = 0; i < arr.length; i++), allowing access to positions and updates.
Enhanced for loop (for-each)
Loop form (for (int v : arr)) that is convenient for reading values but does not provide indices; assigning to v won’t change a primitive array.
Neighbor comparison (adjacent pairs)
An algorithm pattern that compares arr[i] with arr[i-1] (typically starting i at 1) to detect changes like increases or duplicates.
Shifting elements (array)
Moving values left or right to simulate insertion/removal; direction matters to avoid overwriting needed values.
Two-pass filter approach (arrays)
Filtering with fixed-size arrays by first counting matches, then allocating an output array of that size, then filling it.