CHAPTER 9: ALGORITHM DESIGN AND PROBLEM-SOLVING
9.1 COMPUTATIONAL THINKING SKILLS
9.1.1 Abstraction
Definition: The process of removing unnecessary details to focus on essential features.
Need:
- Manage complexity
- Create models of real-world systems
Benefits:
- Focus on what matters
- Reusable solutions
9.1.2 Decomposition
Definition: Breaking down complex problems into smaller, manageable sub-problems.
Benefits:
- Easier to solve smaller problems
- Can work on different parts independently
- Leads to modular programming (procedures/functions)
9.2 ALGORITHMS
9.2.1 Algorithm Representation
Methods:
- Structured English
- Flowchart
- Pseudocode
Components:
- Input
- Process
- Output
Basic Constructs:
- Sequence (order of execution)
- Selection (IF, CASE)
- Iteration (loops)
9.2.2 Pseudocode Guidelines
Input/Output:
<TEXT>
Assignment:
<TEXT>
Selection:
<TEXT>
Iteration:
<TEXT>
9.2.3 Stepwise Refinement
Process:
- Start with general solution
- Gradually add detail
- Continue until can be programmed