top of page
Image by Alexander Grey

Trace Tables

Unit 3 Summary - part 3

Image by Nareeta Martin

Tracing Pseudocode

Trace table is the hardest part of Computer science
Learn these videos carefully
Image by Annie Spratt
Image by Kenrick Mills
Image by Scott Webb
Image by Pawel Czerwinski

Tracing Flowcharts

Image by Alexander Grey

AQA IGCSE's Tracing Pseudocode

Image by Kseniya Lapteva
Image by Pawel Czerwinski
Image by J Lee


AQA IGCSE's Tracing Flowchart
 

Image by Alexander Grey

Oxford AQA IGCSE 2020

Candy Cotton

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

Pseudocode AQA IGCSE 2020 .png

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]

​

__________________________________________________________________________________

Pseudocode31 AQA IGCSE 2020 .png

Answer:

Pseudocode31A AQA IGCSE 2020.png

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.

Image by Codioful (Formerly Gradienta)

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)

Image by Pawel Czerwinski
Visconsio Nekoland Logo.jpg
PT. Visconsio Kaya Jaya Masyhur

© 2020-2023 by Miana Kitty

bottom of page