Past-paper question · 2015 October-November · Paper 41 · Q4(b)

Question 4(b) 2015 · October-November · Paper 41 · 62 marks

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

Official answer for Question 4

Part (b)

Part (b)

✓
Tree
✓
RootPointer
✓
Name
✓
LeftPointer
✓
RightPointer

Question 1

[1]
✓
Dodi

Question 5

Question 2

[2]
✓
Farai

Question 3

Question 4

[3]
✓
Elli
✓
0
✓
0
✓
FreePointer

Question 8

[4]
✓
George
✓
0
✓
0
[5]
✓
Ben

Question 7

Question 6

[6]
✓
Celine
✓
0
✓
0
[7]
✓
Ali
✓
0
✓
0
[8]

Question 9

✓
0
[9]

Question 10

✓
0
[10]
✓
0
✓
0
[7]
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International A Level – October/November 2015
✓
9608

Question 41

Mark scheme 9608_w15_ms_41.pdf →

Show text version of question

Question 4

Part (b)

Question 4

A binary tree Abstract Data Type (ADT) has these associated operations:

  • create the tree (CreateTree)
  • add an item to tree (Add)
  • output items in ascending order (TraverseTree)

Part (b)

The binary tree ADT is to be implemented as an array of nodes. Each node consists of data

and two pointers.

Using pseudocode, a record type, Node, is declared as follows:

TYPE Node DECLARE Name : STRING DECLARE LeftPointer : INTEGER DECLARE RightPointer : INTEGER ENDTYPE

The statement

DECLARE Tree : ARRAY[1:10] OF Node

reserves space for 10 nodes in array Tree.

The CreateTree operation links all nodes into a linked list of free nodes. It also initialises the RootPointer and FreePointer.

Show the contents of the Tree array and the values of the two pointers, RootPointer and FreePointer, after the operations given in part

Part (a)

have been carried out.

Tree RootPointer Name LeftPointer RightPointer

[1]
[2]

FreePointer

[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[7]

Question 12

Topic relevance

Why this question appears here

82% assigned-topic match · Data types and structures › Data types and records

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

Keep practising this topic