Question 4(b)(i) 2021 · May-June · Paper 41 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (b)
(i)
Question 1
mark for rootPointer pointing to 0
Question 4
Question 11
Question 1
Question 5
Question 1
Question 2
Question 4
Question 2
- 1
- 1
Question 3
Question 7
Question 9
Question 4
Question 8
Question 10
Question 5
Question 3
Question 6
Question 6
- 1
- 1
Question 7
- 1
- 1
Question 8
- 1
- 1
Question 9
- 1
- 1
Question 10
- 1
- 1
Question 11
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
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
Question 12
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
