AP®︎ Computer Science A Unit 2: Notes & Study Guide

Prepare for your quiz, test, or the AP exam with a comprehensive review on Unit 2 of AP Computer Science A – Selection and Iteration.

Exam weight: 25–35%
12 Topics

Unit 2: Selection and Iteration

This unit focuses on building algorithms using conditional statements and loops to control program flow and repeat operations.

Begin with Topic 2.1: Algorithms with Selection...

To review Unit 2, go through each of the 12 topics below.

Everything you actually need to know for your Unit 2 test, pulled directly from the AP® Computer Science A curriculum.

Topic 2.1
~7 min
Review
Algorithms with Selection and Repetition
Algorithms with Selection and Repetition
  • The Three Building Blocks of Algorithms
  • How Selection Works in Algorithms
  • How Repetition Works in Algorithms
Review
Topic 2.2
~6 min
Review
Boolean Expressions
Boolean Expressions
  • What Boolean Expressions Are
  • Relational Operators
  • How Boolean Expressions Evaluate
Review
Topic 2.3
~6 min
Review
if Statements
if Statements
  • How If Statements Control Program Flow
  • Types of Selection Statements
  • How Conditions Are Evaluated
Review
Topic 2.4
~6 min
Review
Nested if Statements
Nested if Statements
  • What Nested If Statements Are
  • Multiway Selection with if-else-if
  • How Nested Branching Executes
Review
Topic 2.5
~5 min
Review
Compound Boolean Expressions
Compound Boolean Expressions
  • What Compound Boolean Expressions Are
  • Logical Operators and How They Work
  • Operator Precedence and Grouping
Review
Topic 2.6
~6 min
Review
Comparing Boolean Expressions
Comparing Boolean Expressions
  • What It Means for Boolean Expressions to Be Equivalent
  • De Morgan’s Laws
  • Comparing Object References with Boolean Expressions
Review
Topic 2.7
~6 min
Review
while Loops
while Loops
  • What a While Loop Is
  • The Loop Control Variable Pattern
  • When You Use a While Loop
Review
Topic 2.8
~6 min
Review
For Loops
For Loops
  • What a For Loop Is
  • How a For Loop Executes
  • Standard For Loop Patterns
Review
Topic 2.9
~7 min
Review
Implementing Selection and Iteration Algorithms
Implementing Selection and Iteration Algorithms
  • What Standard Selection and Iteration Algorithms Are
  • The Five Core Algorithm Patterns
  • Writing and Applying These on the Exam
Review
Topic 2.10
~7 min
Review
Implementing String Algorithms
Implementing String Algorithms
  • What String Algorithms Are
  • Character by Character Processing
  • Substring Processing and Pattern Counting
Review
Topic 2.11
~6 min
Review
Nested Iteration
Nested Iteration
  • What Nested Iteration Is
  • How Nested Loops Execute and How to Trace Them
  • Common Patterns You Must Recognize
Review
Topic 2.12
~7 min
Review
Informal Run-Time Analysis
Informal Run-Time Analysis
  • What Informal Run-Time Analysis Is
  • Recognizing Common Growth Patterns
  • Counting Executions Step by Step
Review

Notes

1 credit used · 5/5 remaining