Past-paper question · 2018 October-November · Paper 43 · Q4(c)(i)

Question 4(c)(i) 2018 · October-November · Paper 43 · 2 marks

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

Official answer for Question 4

Part (c)

(i)

Question 1

mark per bullet point:

Question 2

✓
•
✓
Each time it calls itself the variables are put onto the stack // The function call itself too many times
✓
•
✓
« it runs out of stack space // stack overflow
✓
9608/43
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November 2018
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w18_ms_43.pdf →

Show text version of question

Question 4

Part (c)

(i)

Question 4

The recursive algorithm for the Calculate() function is defined as follows:

01 FUNCTION Calculate(BYVALUE Number : INTEGER) RETURNS INTEGER

02 IF Number = 0

03 THEN

04 Calculate −10

05 ELSE

06 Calculate Number * Calculate(Number − 1)

07 ENDIF

08 ENDFUNCTION

A
recursive algorithm within a subroutine can be replaced with an iterative algorithm.

(i)

Describe one problem that can occur when running a subroutine that has a recursive

algorithm.

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

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

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

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

[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_w18_qp_43.pdf

Keep practising this topic