Past-paper question · 2015 May-June · Paper 43 · Q6(b)

Question 6(b) 2015 · May-June · Paper 43 · 2 marks

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

Official answer for Question 6

Part (b)

Part (b)

Before procedure call is executed current state of the registers/local variables is saved onto

✓
the stack
✓
When returning from a procedure call the registers/local variables are re-instated
[2]

Mark scheme 9608_s15_ms_43.pdf →

Show text version of question

Question 6

Part (b)

Question 6

A recursively defined procedure X is defined below:

PROCEDURE X(BYVALUE n : INTEGER) IF (n = 0) OR (n = 1) THEN OUTPUT n ELSE CALL X(n DIV 2) OUTPUT (n MOD 2) ENDIF ENDPROCEDURE

Part (b)

Explain how a stack is used during the execution of a recursive procedure.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

..............................................................................................................................................

[2]
Topic relevance

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

Keep practising this topic