Skip to content

Algorithmic Efficiency: Fast vs Slow

Beginning of the lesson

Fast vs Slow: How Smart Is Your Plan?

A friendly first look at why some solutions are much faster than others

Big Idea: Two plans can both get the right answer, but one can be far faster than the other. As the amount of stuff (the data) grows, a slow plan gets slow very quickly, while a smart plan stays fast. Learning to pick the fast plan is called thinking about efficiency.
By the end you will be able to:
  • explain what "efficiency" means in simple words,
  • tell the difference between a fast plan and a slow plan,
  • read a simple growth chart and name three speeds: same-work, one-by-one, and much-more.

1. Same answer, different speed

Imagine you drop a box of 100 crayons on the floor. You want to find the red one. You could pick up crayons one at a time and check each colour. Or a friend could hand you a box where the crayons are already sorted by colour, so you go straight to the reds.

Both plans find the red crayon. But one takes many more steps than the other. In computing we call a set of clear steps that solves a problem an algorithm. The same problem can have a fast algorithm and a slow algorithm. Efficiency means: how much work does the plan need to do?

A right answer that takes forever is not much help. Good programmers look for the answer and a fast way to get it.

2. Count the steps, not the seconds

A fast computer and a slow computer finish in different times, so seconds can trick us. Instead, programmers count steps — how many little actions the plan does. Counting steps works on any computer.

The important question is not "how long for 10 things?" It is: "what happens when the number of things gets much bigger?" If you have 10 crayons, checking one-by-one is fine. If you have 1,000,000 crayons, one-by-one could take all day, while a smart plan still finishes in a blink.

The special way programmers talk about "how the number of steps grows as the data grows" has a nickname: Big-O. You do not need any hard math — think of it as a label that says fast, medium, or slow as things get bigger.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers