Question 3(c)(iii) 2025 · May-June · Paper 41 · 6 marks
Reveal official mark-scheme answer


Official answer for Question 3
Part (c)
(iii)
Question 1
mark each to max 6
Question 6
- Insert method header (and end) taking 1 node parameter
- If parameter < first node, checking if there is a left node …
- … storing node in left node if it is null
- If parameter >= first node, checking if there is a right node …
- … storing node in right node if it is null
- Looping until correct position is found // recursive calls
Show text version of question
Question 3
Part (c)
(iii)
Question 3
A program stores data in a binary tree that is designed using Object‑Oriented Programming
(OOP).
The tree stores data in ascending numerical order, for example:
Question 30
20 45
1 21 33 63
The class Node stores data about the nodes.
Node NodeData : Integer stores the node’s integer data
LeftNode : Node stores the node that is stored to the left of the current node, or a null value if there is no node to the left
RightNode : Node stores the node that is stored to the right of the current node, or a null value if there is no node to the right Constructor() initialises NodeData to its parameter value; initialises LeftNode and RightNode to a null value
GetLeft() returns LeftNode
GetRight() returns RightNode
GetData() returns NodeData
SetLeft() takes an object of type Node as a parameter and stores it in LeftNode
SetRight() takes an object of type Node as a parameter and stores it in RightNode
Question 7
The class Tree stores the tree.
Tree FirstNode : Node stores the root node in the tree Constructor() initialises FirstNode to its parameter value
GetRootNode() returns the node stored in FirstNode
Insert() stores its parameter node in the correct position in the tree
(iii)
The method Insert() takes a node as a parameter and then searches the tree to find
the position to insert the new node by:
- checking whether the node’s data is less than or greater than the root node’s data
- moving to the left node if the data is less than the root node’s data
- moving to the right node if the data is greater than or equal to the root node’s data
- repeating until the final position of the node is found and stores the node in that
position.
Write program code for Insert()
Save your program.
Copy and paste the program code into part 3(c)(iii) in the evidence document.
Question 9
Why this question appears here
98% assigned-topic match · Computational thinking and problem-solving › Recursion
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 9618_s25_qp_41.pdf
