Computer Science · Oct / Nov 2022 · Paper 1 HL · Question 9
Adapt for 2027Tracing a simple recursive algorithm is B2.4.5 (HL only); rewrite the IB pseudocode in Python or Java.
IBCS
As printed in the paper
The question as text
9. Given the one-dimensional array NAMES: [0] Zixan [1] Murali [2] Eli [3] Kim and the following recursive algorithm: mystery(A, N) // A is a one-dimensional array, N is an integer if N>0 then mystery(A, N-1) end if output(A[3-N]) end mystery determine the output produced after execution of the following statement: mystery(NAMES, 3) Show all your working. [4]
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

