Login or Create an Account to view the mark scheme, comment, and add to a test
A search algorithm uses recursion to sort a one-dimensional array by sorting the end of the array and returning the array minus the last element at each recursive step.
Identify, in words, what the base case of this sorting algorithm must be
Outline how binary tree traversal uses the concept of recursion
Consider the following algorithm func(N) if N=0 then return 1 else if (N % 2 == 0) return N - func(N-1) else return N + func(N-1) end if end method
State what would occur if the first "if statement" was removed
Trace the algorithm when N=4
State the final output of the algorithm when N=4

Extended Response10 MarksCommunity
22 Uses64 Views1 Like