Sample Cheat Sheets: Algorithm Design And Problem-Solving
IGCSE / O Level Computer Science Cheat Sheet
Topic: 7 – Algorithm Design and Problem-Solving
🔁 Program Development Life Cycle (PDLC)
| Stage | Description |
|---|---|
| Analysis | Define the problem, input/output, abstraction, decomposition |
| Design | Plan using pseudocode, flowcharts, structure diagrams |
| Coding | Write program using chosen language |
| Testing | Use test data to validate the program’s correctness |
🔍 Problem Decomposition
- Break a large problem into smaller, manageable sub-problems
- Enables easier design and reuse of code
📐 Design Techniques
| Method | Use |
|---|---|
| Pseudocode | Structured, language-independent steps |
| Flowchart | Visual diagram of process flow |
| Structure Diagram | Hierarchical breakdown of modules |
🧮 Standard Algorithms
| Algorithm | Purpose |
|---|---|
| Linear search | Search for item one-by-one |
| Bubble sort | Repeatedly swap adjacent elements |
| Totalling | Add values in a list |
| Counting | Count how often a value occurs |
| Max/Min | Find largest/smallest value |
| Average | Total ÷ number of items |
🧪 Types of Test Data
| Type | Description |
|---|---|
| Normal | Expected and valid input |
| Abnormal | Invalid input (e.g. letters in numeric field) |
| Extreme | Valid but at the very edge (e.g. 0 or 100) |
| Boundary | Values at the limits of valid/invalid |
🧷 Validation Checks
| Type | Purpose |
|---|---|
| Range | Within set limits (e.g. 1–100) |
| Length | Correct number of characters |
| Type | Correct data type (e.g. number, text) |
| Presence | Field is not empty |
| Format | Matches specific pattern (e.g. date) |
| Check digit | Algorithm-generated digit to verify input |
🔒 Verification Methods
| Method | Description |
|---|---|
| Visual check | User manually checks for accuracy |
| Double entry | Entered twice, compared by system |
📊 Trace Tables
- Used to dry-run an algorithm step-by-step
- Tracks variable values and output for each step
🧠 Writing and Debugging Algorithms
- Can be asked to:
- Write pseudocode or flowcharts from a scenario
- Complete or correct faulty logic
- Translate between logic forms (e.g. expression ↔ table)
- Must use precise syntax (e.g.
x > y, not “x is greater than y”)
