Computer Science For First Examination In 2021 9618 · 19

19.2 Recursion

47 questions in this subtopic. Open a question to solve it and check the official answer.

Reset
2025 October-November · Paper 31 · Q9(b)

Recursion · 3 marks · official answer ready

(b) A stack is used to implement recursion. State the three essential features of recursion. 1 ....................................................................................…

2025 October-November · Paper 32 · Q12(b)

Recursion · 3 marks · official answer ready

(b) Explain the reasons why a stack is used when a recursive algorithm is executed. ...............................................................................................…

2025 October-November · Paper 33 · Q11

Recursion · 3 marks · official answer ready

11 Describe when the use of recursion would be beneficial and give an example. Description ........................................................................................…

2025 October-November · Paper 42 · Q2(e)

Recursion · 6 marks · official answer ready

(e) The recursive function RecursiveBinarySearch() takes four parameters: • an integer array • the lower bound of the array • the upper bound of the array • the value to find in t…

2025 October-November · Paper 43 · Q3(a)(i)

Recursion · 6 marks · official answer ready

3 A program is written to perform different individual processes using arrays. (a) A 1D array stores 10 integers. (i) A recursive function RecursiveCount() takes three parameters:…

2025 October-November · Paper 43 · Q9(f)(ii)

Recursion · 30 marks

(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot(s) into part 2(f)(ii) in the evidence document. [1] 12 3 A program is …

2025 May-June · Paper 31 · Q4(b)

Recursion · 2 marks · official answer ready

(b) Describe what is meant by recursion. ..........................................................................................................................................…

2025 May-June · Paper 31 · Q4(c)

Recursion · 1 mark · official answer ready

(c) A binary tree is a suitable Abstract Data Type (ADT) that a designer can implement using recursive algorithms. Identify one other ADT that a designer can implement using recur…

2025 May-June · Paper 32 · Q11(b)

Recursion · 2 marks · official answer ready

(b) A binary tree can be used to implement recursion. Identify one feature of an algorithm that makes it beneficial to use recursion. Give one example of an application that could…

2025 May-June · Paper 33 · Q13

Recursion · 100 marks · official answer ready

13 The recursive procedure Delete() is defined as follows: PROCEDURE Delete(Index, Target) IF Numbers[Index] > 0 THEN IF Numbers[Index] >= Target THEN Numbers[Index] Numbers[Index…

2025 May-June · Paper 41 · Q3(c)(iii)

Recursion · 6 marks · official answer ready

(iii) The method Insert() takes a node as a parameter and then searches the tree to find the position to insert the new node by: • checking whether the node’s data is less than or…

2025 May-June · Paper 41 · Q3(d)

Recursion · 5 marks · official answer ready

(d) The recursive procedure OutputInOrder() outputs the data stored in the binary tree in ascending numerical order. The procedure takes a Node object as a parameter and then: • c…

2025 May-June · Paper 43 · Q2(e)

Recursion · 6 marks · official answer ready

(e) The function Search() performs a binary search to find ItemToFind in DataArray The function takes two parameters: • DataArray, an array of integers • ItemToFind, an integer to…

2024 October-November · Paper 41 · Q3(d)(i)

Recursion · 5 marks · official answer ready

(i) Write program code for RemoveData(). Save your program. Copy and paste the program code into part 3(d)(i) in the evidence document. [5]

2024 October-November · Paper 43 · Q3(d)(i)

Recursion · 5 marks · official answer ready

(i) Write program code for RemoveData(). Save your program. Copy and paste the program code into part 3(d)(i) in the evidence document. [5]

2024 May-June · Paper 42 · Q3(b)(i)

Recursion · 4 marks · official answer ready

(i) The following recursive pseudocode function sorts the array into ascending order using an insertion sort and returns the sorted array. DECLARE LastItem : INTEGER DECLARE Check…

2024 May-June · Paper 42 · Q3(b)(ii)

Recursion · 2 marks · official answer ready

(ii) Amend the main program to: • call RecursiveInsertion()with the initialised array NumberArray and the number of elements as parameters • output the word ‘Recursive’ • output t…

2024 May-June · Paper 42 · Q3(b)(iii)

Recursion · 1 mark · official answer ready

(iii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 3(b)(iii) in the evidence document. [1]

2024 May-June · Paper 42 · Q3(c)(i)

Recursion · 4 marks · official answer ready

(i) Write program code for the function IterativeInsertion()to perform the same processes as RecursiveInsertion()but using iteration instead of recursion. Save your program. Copy …

2024 May-June · Paper 42 · Q3(c)(ii)

Recursion · 1 mark · official answer ready

(ii) Write program code to amend the main program to also: • call IterativeInsertion()with the original initialised array NumberArray • output the word ‘iterative’ • output the co…