Question 4(c)(i) 2015 · October-November · Paper 43 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (c)
(i)
Part (c)
(i)
01 PROCEDURE TraverseTree(BYVALUE Root : INTEGER)
Question 10
Show text version of question
Question 4
Part (c)
(i)
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)
programmer writes a recursive procedure in pseudocode.
(i)
Complete the pseudocode:
01 PROCEDURE TraverseTree(BYVALUE Root: INTEGER)
02 IF Tree[Root].LeftPointer .................................................................
03 THEN
04 TraverseTree( .............................................................................)
05 ENDIF
06 OUTPUT .............................................................................................. .Name
07 IF ........................................................................................................ <> 0
08 THEN
09 TraverseTree( .............................................................................)
10 ENDIF
11 ENDPROCEDURE
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 9608_w15_qp_43.pdf
