

Trace Tables
Unit 3 Summary - part 3

Tracing Pseudocode
Trace table is the hardest part of Computer science
Learn these videos carefully




Tracing Flowcharts

AQA IGCSE's Tracing Pseudocode



AQA IGCSE's Tracing Flowchart

Oxford AQA IGCSE 2020

03.0.
Figure 1 shows two different algorithms for calculating the sum of all of the whole numbers between 1 and a positive number N.
​
For example:
​
-
if N = 4 then the algorithms would both output 10 as 1+2+3+4 = 10
-
if N = 6 then the algorithms would both output 21 as 1+2+3+4+5+6 = 21
​
Figure 1

03.1.
Complete the trace table below to show how the values of the variables would change if Algorithm A were carried out and the number 5 were input for N. [3 marks]
​
__________________________________________________________________________________

Answer:

1 mark: Correct initial values in the N and Sum columns (5 and 0).
1 mark: Correct sequence of values in the Value column and no other values.
1 mark: Correct sequence of values in the Sum column and no other values.
Max 2 if any incorrect or omitted values.

03.2.
Algorithm B is said to be more efficient than Algorithm A. Explain what is meant by efficient in this context. [1 mark]
​
__________________________________________________________________________________
​
Alternative answers:
​
-
The amount of time taken / the number of steps/commands/instructions carried out (by an algorithm);
-
The amount of memory used (when the program is running)
​
​
​
03.3.
Describe why Algorithm B is more efficient than Algorithm A. [2 marks]
​
__________________________________________________________________________________
​
Alternative answers:
​
-
Algorithm B always carries out the same number of commands/instructions (regardless of the value in N);​
-
A number between 3 and 5 for “same number”​
-
Carries out one calculation as BOD
​​
​
-
Algorithm A uses a loop so as N increases it will need to carry out more commands/instructions;​
-
Carries out N calculations
​​
​
-
Algorithm B contains fewer commands/instructions (This answer is not enough to get a mark)

