Past-paper question · 2021 May-June · Paper 41 · Q4(b)(i)

Question 4(b)(i) 2021 · May-June · Paper 41 · 4 marks

Original past-paper question for 4(B)(I)
Original past-paper question for 4(B)(I)
Original past-paper question for 4(B)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 4(B)(I)

Official answer for Question 4

Part (b)

(i)

Question 1

mark for rootPointer pointing to 0

Question 4

✓
1 mark for freePointer pointing to 11
✓
1 mark for left and right correctly linked nodes 0 TO 5
✓
1 mark for -1 added as pointer for all remaining null pointers
✓
rootPointer
✓
0
✓
Index
✓
leftPointer
✓
data
✓
rightPointer
✓
freePointer

Question 11

✓
0

Question 1

✓
M

Question 5

Question 1

Question 2

✓
C

Question 4

Question 2

  • 1
✓
A
  • 1

Question 3

Question 7

✓
L

Question 9

Question 4

Question 8

✓
G

Question 10

Question 5

Question 3

✓
R

Question 6

Question 6

  • 1
✓
W
  • 1

Question 7

  • 1
✓
J
  • 1

Question 8

  • 1
✓
D
  • 1

Question 9

  • 1
✓
P
  • 1

Question 10

  • 1
✓
H
  • 1

Question 11

✓
(-1)
✓
(-1)

Mark scheme 9608_s21_ms_41.pdf →

Show text version of question

Question 4

Part (b)

(i)

Question 4

Chon creates a binary tree structure to store options that the user can select from a menu (M) in

his program.

M

C
R
A
G L W

Each node in the binary tree is stored using the following record structure:

TYPE node

leftPointer : INTEGER

data : STRING

rightPointer : INTEGER

ENDTYPE

The tree is stored as a 1D array, binaryTree. Null pointers are represented by –1.

(i)

The table shows the contents of the three fields in each record stored in the 1D array

binaryTree.

Complete the table to show the contents of binaryTree from part (a).

rootPointer Index leftPointer data rightPointer

0 M

freePointer 1 C

2 A

3 L

4 G

5 R

6 W

7 J

8 D

9 P

10 H

Question 11

[4]

Question 12

Topic relevance

Why this question appears here

71% assigned-topic match · Data types and structures › Arrays

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_s21_qp_41.pdf

Keep practising this topic