Computing · Stage 6

Compare Algorithms: Correctness & Efficiency

Programs & Judgement · comparing algorithms · check correctness first, then compare efficiency

✦ Computing📘 Stage 6 · S6⏱ ~14 min🧒 Ages 10–12★ Free to start
I can compare two algorithms for correctness and efficiency.
Kavi the owl for Computing
📖

Kavi Judges Two Robots

Two robot owls each hooted, "I can find the biggest acorn!" One robot checked every acorn and always found the biggest — but it was slow. The other grabbed the first acorn it saw — super fast, but it often grabbed the wrong one! "Both robots run," said Kavi, "but running isn't enough." So Kavi judges every algorithm with two questions, and always in order. First: Is it correct? — does it give the right answer for every case? Then, only for the ones that pass: Is it efficient? — which does the least work? "A fast wrong answer is still wrong," hooted Kavi. "Check correct first — then pick the fastest of the ones that are right!"

🎓

What your child will learn

1Judge any algorithm with two questions — in orderWhen two algorithms both run, you can't just grab one. Ask two questions, and always in this order. Tap each to learn its job.
2A fast answer is no good if it's wrongTwo algorithms try the same task. First decide if each is correct — then think about speed. Reveal to check, then try the next.
3Two correct algorithms — which does less work?Both of these count 20 stars correctly. Since both are correct, the better one is the one that does less work. Tap each to compare.
4Is this about correctness or efficiency?
🔍

A peek inside

Two algorithms find the largest number in a list. Algorithm A checks every number; Algorithm B just returns the first number. Which is better?
first ask: is each one correct? B only looks at one number, so it can easily miss the largest → B is WRONG. A checks all the numbers → A is correct.

Try this at home: When you compare two algorithms, which do you check FIRST — correctness or efficiency?

Ready to play and learn?

Start the free interactive lesson, or print the handout for screen-free play.

Part of Computing · Stage 6 · S6 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.