Solving Problems with Pseudocode

Logo

Pseudocode

Pseudocode is a concept that we are going to borrow from software engineering to help us solve problems. When there is a problem you can not solve within 10 seconds and it's more challenging, it may require working things out. The first step in solving such a problem is to write pseudocode.

What is Pseudocode?

Pseudocode involves writing down the steps you are going to take in mostly words, rather than actual code. This helps in planning out the solutions, especially for complicated problems that are hard to keep track of in your head.

  1. Write Down the Pseudocode: Start by writing down the pseudocode steps to solve the problem. This helps in identifying tough spots and unforeseen challenges.
  2. Break Down the Problem: Take the big problem and break it down into many big sub-problems. Then, break those sub-problems down into smaller, manageable steps.
  3. Identify Challenges: Writing pseudocode helps uncover areas of the problem or solution that you didn't foresee. It allows you to see potential issues and choose the right solution path.
  4. Check Requirements: Ensure that every part of the pseudocode is solvable from A to Z and addresses all the requirements of the problem.
  • Manageable Steps: Instead of dealing with a big problem, with this strategy you have many tiny and manageable steps, which boosts your confidence and momentum.
  • Uncover Issues: Pseudocode helps to identify previously unknown problems and helps you choose the right solution type.
  • Scalability: This strategy helps to ensure that your solution works in different scenarios and scales appropriately.

Next Steps

In the next video, we will look at a pseudocode exercise. Following that, I will provide my own solutions for that exercise.