Computer Science For First Examination In 2021 9618 · 19

Computational thinking and problem-solving

60 questions. Open a question to solve it and check the official answer.

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 · Q10

Algorithms · 4 marks · official answer ready

10 Identify the two main protocols that form Transport Layer Security (TLS) and state the purpose of each. Protocol 1 .............................................................…

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 · Q10(a)

Algorithms · 1 mark

10 (a) State the purpose of the A* and Dijkstra’s algorithms. .....................................................................................................................…

2025 May-June · Paper 33 · Q10(b)

Algorithms · 2 marks · official answer ready

(b) Outline the difference between the A* and Dijkstra’s algorithms. ..............................................................................................................…

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…