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 4 · Data Collections

Data Collections

Store and process groups of data. Master arrays, 2D arrays, and ArrayList; traverse them with loops; read from text files; use wrapper classes; and apply the standard searching, sorting, and recursion algorithms. This is the largest unit on the exam.

17 topics
30–40% of the exam
~50–52 class periods
College Board aligned
← Back to AP Computer Science A

Choose your study tool

Six ways to master Unit 4 — pick whichever fits how you like to study.

Flashcards
24 interactive flashcards covering arrays, ArrayList, 2D arrays, searching, sorting, and recursion. Tap to flip.
Open flashcards →
Cheat Sheet
A one-page visual summary of Unit 4 — every collection, traversal, and algorithm on a single screen.
Open cheat sheet →
Essentials
The core concepts plus a searchable glossary of every vocabulary term you need to know for the exam.
Open essentials →
Visual Review
A slide-by-slide walkthrough of Unit 4 with array diagrams, traversal patterns, and searching/sorting traces.
Open visual review →
MCQ Practice
35 multiple-choice questions in College Board exam style — with full explanations of every answer.
Start practice →
FRQ Practice
A free-response question with model answers showing exactly how each part earns its point on the exam.
Start FRQ →

Topics in Unit 4

All 17 topics from the College Board CED, in order.

Topic 4.1
Ethical & Social Issues Around Data
The responsibilities and impact of collecting and using data.
Topic 4.2
Introduction to Using Data Sets
Why programs store and process collections of data.
Topic 4.3
Array Creation and Access
Declaring arrays, indices, and array.length.
Topic 4.4
Array Traversals
Visiting each element with for and enhanced for loops.
Topic 4.5
Implementing Array Algorithms
Standard algorithms: min, max, sum, count, and more.
Topic 4.6
Using Text Files
Reading data from a file with a Scanner.
Topic 4.7
Wrapper Classes
Integer and Double, autoboxing and unboxing.
Topic 4.8
ArrayList Methods
add, get, set, remove, and size.
Topic 4.9
ArrayList Traversals
Looping over an ArrayList and safe removal.
Topic 4.10
Implementing ArrayList Algorithms
Standard algorithms on a resizable list.
Topic 4.11
2D Array Creation and Access
Declaring and indexing row-by-column grids.
Topic 4.12
2D Array Traversals
Nested loops over rows and columns.
Topic 4.13
Implementing 2D Array Algorithms
Standard algorithms on a 2D grid.
Topic 4.14
Searching Algorithms
Sequential (linear) search and binary search.
Topic 4.15
Sorting Algorithms
Selection sort and insertion sort.
Topic 4.16
Recursion
Methods that call themselves; base and recursive cases.
Topic 4.17
Recursive Searching and Sorting
Binary search and merge sort with recursion.

About Unit 4

Unit 4 is about storing and processing collections of data — and at 30–40% of the exam it is by far the largest unit. You start with the ethical and social issues of data collection, then learn the three core structures. An array is a fixed-size, indexed collection (indices 0 to length−1); an ArrayList is a resizable list with methods like add, get, set, remove, and size; and a 2D array is a grid accessed by row and column.

For each, you write traversals (standard for loops and the enhanced for-each loop) and standard algorithms — finding a min/max, summing, counting, and filtering. You’ll read data from text files with a Scanner and use wrapper classes (Integer, Double) with autoboxing. The unit finishes with the classic algorithms: sequential and binary search, selection and insertion sort, and recursion — methods that call themselves, including recursive binary search and merge sort.

This unit takes about 50–52 class periods and is central to the Data Analysis free-response question. The five computational thinking practices below run through every topic:

Practice 1
Design Code
Practice 2
Develop Code
Practice 3
Analyze Code
Practice 4
Document Code
Practice 5
Use Computers Responsibly
You’ve reached the end
That’s all 4 units — back to the AP Computer Science A hub
Course home →