Past-paper question · 2015 October-November · Paper 22 · Q5(a)(i)

Question 5(a)(i) 2015 · October-November · Paper 22 · 8 marks

Original past-paper question for 5(A)(I)
Original past-paper question for 5(A)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 5(A)(I)

Official answer for Question 5

Part (a)

(i)

Part (a)

(i)

✓
N
✓
i
✓
j
✓
Temp

Question 1

Question 2

Question 3

Question 4

Question 5

Question 11

Question 16

Question 13

Question 7

Question 8

Question 5

Question 1

Question 1

Question 2

Question 13

Question 16

Question 3

Question 7

Question 16

Question 4

Question 8

Question 16

✓
Terminates at 5 and
✓
4 respectively

Question 5

Question 2

Question 1

Question 2

Question 7

Question 13

Question 3

Question 8

Question 13

Question 4

Question 3

Question 1

Question 7

Question 11

Question 2

Question 8

Question 11

Question 3

Question 4

Question 1

✓
final values are:

Question 2

Question 7

Question 8

Question 11

Question 13

Question 16

✓
Note these final values will not be
✓
Must be:
✓
shown on the same row …
  • Preceded by other entries …
  • nothing after the 1, 2 sequence
[8]

Mark scheme 9608_w15_ms_22.pdf →

Show text version of question

Question 5

Part (a)

(i)

Question 5

A program is to process a set of integers.

The integers are stored in an array, Num. The first N elements are to be processed.

The pseudocode for this program is shown below:

FOR i ←1 TO (N - 1) j ←

Question 1

REPEAT IF Num[j] > Num[j + 1] THEN Temp ← Num[j] Num[j] ← Num[j + 1] Num[j + 1] Temp ← ENDIF j ← j + 1 UNTIL j = (N – i + 1) ENDFOR

(i)

Trace the execution of the pseudocode for the value N = 5 and the given array of integers.

Num N i j Temp 1 2 3 4 5

5 11 16 13 7 8

[8]

Question 12

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w15_qp_22.pdf

Keep practising this topic