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.

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…

2024 May-June · Paper 42 · Q3(c)(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(c)(iii) in the evidence document. [1] 13

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

Recursion · 6 marks · official answer ready

(i) Write program code for the recursive function BinarySearch(). Save your program. Copy and paste the program code into part 3(d)(i) in the evidence document. [6]

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

Recursion · 2 marks · official answer ready

(ii) Write program code to amend the main program to: • call BinarySearch()with the sorted array and the integer 644 as the search value • output ‘Not found’ if 644 is not found i…

2024 May-June · Paper 42 · Q3(d)(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(d)(iii) in the evidence document. [1] 14 15 16 Permission…

2023 October-November · Paper 32 · Q8

Algorithms · 5 marks · official answer ready

8 Calculate the shortest distance between the Start and each of the destinations in the diagram using Dijkstra’s algorithm. Show your working and write your answers in the table p…

2023 October-November · Paper 32 · Q9(c)

Recursion · 4 marks · official answer ready

(c) Explain how a compiler makes use of a stack when translating recursive programming code. ......................................................................................…

2023 October-November · Paper 41 · Q1(b)(i)

Recursion · 6 marks · official answer ready

(i) Rewrite the function IterativeVowels() as a recursive function with the identifier RecursiveVowels(). Save your program. Copy and paste the program code into part 1(b)(i) in t…

2023 May-June · Paper 31 · Q2(b)

Algorithms · 2 marks · official answer ready

(b) Describe the purpose of both the A* algorithm and Dijkstra’s algorithm. .......................................................................................................…

2023 May-June · Paper 31 · Q9(b)

Algorithms · 4 marks · official answer ready

(b) Identify two benefits and two drawbacks of quantum cryptography. Benefit 1 ....................................................................................................…

2023 May-June · Paper 31 · Q12(a)

Recursion · 2 marks · official answer ready

12 (a) Describe what is meant by recursion. .......................................................................................................................................…

2023 May-June · Paper 31 · Q12(b)

Recursion · 5 marks · official answer ready

(b) A Fibonacci sequence is a series of numbers formed by adding together the two preceding numbers, for example: 0, 1, 1, 2, … This function calculates and returns values in the …

2023 May-June · Paper 33 · Q2(b)

Algorithms · 2 marks · official answer ready

(b) Describe the purpose of both the A* algorithm and Dijkstra’s algorithm. .......................................................................................................…

2023 May-June · Paper 33 · Q9(b)

Algorithms · 4 marks · official answer ready

(b) Identify two benefits and two drawbacks of quantum cryptography. Benefit 1 ....................................................................................................…

2023 May-June · Paper 33 · Q12(a)

Recursion · 2 marks · official answer ready

12 (a) Describe what is meant by recursion. .......................................................................................................................................…

2023 May-June · Paper 33 · Q12(b)

Recursion · 5 marks · official answer ready

(b) A Fibonacci sequence is a series of numbers formed by adding together the two preceding numbers, for example: 0, 1, 1, 2, … This function calculates and returns values in the …

2022 October-November · Paper 42 · Q3(d)

Recursion · 6 marks · official answer ready

(d) The following iterative pseudocode function calculates the total of all the values stored in the queue. FUNCTION IterativeOutput(Start: INTEGER) RETURNS INTEGER DECLARE Total …

2022 October-November · Paper 42 · Q3(e)(i)

Recursion · 1 mark · official answer ready

(i) Amend the main program by writing program code to perform this task. Save your program. Copy and paste the program code into part 3(e)(i) in the evidence document. [1]