AP Computer Science Principles · Unit 3: Algorithms & Programming
3.9 Developing Algorithms
Three algorithm-building strategies
Developers use different strategies depending on the problem: sequential algorithms perform steps in order, one after another; parallel algorithms run multiple instructions simultaneously across processors; and algorithms that use iteration repeat a set of steps until a condition is met (e.g., checking every item in a list).
Sequencing, selection, and iteration
All algorithms are built from combinations of sequencing (ordered steps), selection (using conditionals like if/else to choose a path), and iteration (loops that repeat steps). Combining these building blocks lets programmers create algorithms that solve a wide range of problems, from simple calculations to complex data processing.
Choosing the right strategy
The best strategy depends on the task: a sequential algorithm works for straightforward, ordered tasks; a parallel algorithm speeds up work that can be split into independent subtasks (like searching different sections of data at once); and iterative approaches efficiently handle repetitive tasks such as searching or summing a list.
Key terms
- Sequential algorithm
- An algorithm where steps are executed one after another, in order.
- Parallel algorithm
- An algorithm that executes multiple instructions simultaneously, often to save time.
- Iteration
- A programming building block that repeats a set of steps until a condition is met (loops).
- Selection
- A building block that uses conditionals (if/else) to choose between different paths in an algorithm.
- Sequencing
- A building block where instructions are carried out in a specific, linear order.
Try an AP-style question
Which three building blocks can express every algorithm?
- Input, output, and storage
- Sequencing, selection, and iteration
- Variables, lists, and strings
- Compression, encryption, and search
Show the answer
B. Structured programming.
Practice 8 AP-style questions with instant explanations, flashcards and spaced review.
Study 3.9 free in APrep