Problem Solving in Computer Science

Definition

Problem solving is the process of analyzing a situation and behaving accordingly to generate a response.

Simple Problem Solving Process (4 steps)

  1. Define and analyze a problem: Identify what the problem is and why it's happening.
  2. Design a plan: Determine the algorithm or approach to solve the problem.
  3. Implement the plan: Code the solution using a programming language.
  4. Evaluate: Assess if the plan worked as intended.

Complex Problem Solving Process (6 steps)

  1. Define and analyze a problem
  2. Decompose the problem: Break it down into manageable sub-problems.
  3. Identify potential plans for each sub-problem: Develop multiple approaches (e.g., plan A, plan B, plan C).
  4. Select and design the best plan
  5. Implement that plan
  6. Evaluate

Important Considerations

  • Before taking action, thoroughly investigate the problem to capture all relevant aspects.
  • Properly define and analyze the problem.
  • When defining a problem, ensure clarity and specify the objectives.