Trace tables
A trace table records every variable at each step, to check the algorithm works.
| Pass | n | n > biggest? | biggest after |
|---|---|---|---|
| 1 | 7 | No | 7 |
| 2 | 3 | No | 7 |
| 3 | 12 | Yes | 12 |
| 4 | 5 | No | 12 |
Output: 12. Correct.
Topic 11 Algorithms
KS3 Computing · An algorithm is a precise, step-by-step plan to solve a problem. Computational thinking turns a messy problem into one. Every algorithm is built from just three things: sequence, selection and iteration.
ProgrammingCambridge Lower Secondary Computing 0860
Say each word, then read what it means. Every one is in the glossary too.
Read it here, or open the study page below to go one step at a time with things to try.
A trace table records every variable at each step, to check the algorithm works.
| Pass | n | n > biggest? | biggest after |
|---|---|---|---|
| 1 | 7 | No | 7 |
| 2 | 3 | No | 7 |
| 3 | 12 | Yes | 12 |
| 4 | 5 | No | 12 |
Output: 12. Correct.
Open the study page and go one step at a time.
One question at a time. The reason shows after each answer.