Note AcademyNote Academy

Computer Science · Oct / Nov 2017 · Paper 1 HL · Question 6

Adapt for 2027Tracing a recursive method and rewriting it with a loop fits recursion (B2.4.4-B2.4.5, HL only); the pseudocode needs rewriting in Python or Java.

IBCS

As printed in the paper

The question as text

6. Consider the following recursive method, where N is a positive integer mystery(N) if (N > 0) AND (N mod 2 = 0) then mystery(N−2) end if output N end mystery

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 6(a)[1]

  • 6(b)[3]

  • 6(c)[4]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.