Question 6(c)(i) 2005 · October-November · Paper 3 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (c)
(i)
Part (c)
(i)
(ii)
-Read root
- Compare with clutch
- Clutch<Radio therefore traverse left subtree
- Read root (Brakes)
- Compare with Clutch
- Clutch>brakes, therefore traverse right subtree
- Root empty
- Insert Clutch
(iii)
-Traverse left subtree
- Read/output the root
- Traverse right subtree
- Route
- Indication of when nodes are read
- Description of diagrammatic representation
Question 3
Show text version of question
Question 6
Part (c)
(i)
The details of a car part are stored in a binary tree according to this algorithm
READ VALUE NEW_PART START AT ROOT NODE WHILE NODE NOT EMPTY, DO IF NEW_PART < VALUE AT NODE THEN FOLLOW LEFT SUBTREE ELSE FOLLOW RIGHT SUBTREE ENDIF ENDWHILE INSERT NEW_PART AT NODE END
(i)
Show the binary tree after the following values have been input
Radio Visor Brakes Tyres Alternator Windscreen
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 9691_w05_qp_3.pdf
