This is an algorithm trace task. No implementation is required.
Read the following algorithm for the recursive function called Mystery. X( ) is a one-dimensional array.
(a) Write down the exact output when the function is called with [2 Marks]
(b) The function is called with Mystery(A( ), 3) where A(1) = 28, A(2) = 20 and A(3) = 28.
Produce a diagram showing each step of the algorithm and the function calls. [9 Marks]
(c) Describe the purpose of the algorithm. 
(d) Write an iterative algorithm that does the same task as the recursive algorithm. 
This task was worth 21 Marks. It was an algorithm trace task. No implementation is required that originally appeared in OCR 2507 Task 4 Jun 2005. All rights and copyright to OCR. Please refer to the OCR Copyright Statement for further information.