Computational thinking and problem-solving
60 questions. Open a question to solve it and check the official answer.
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]
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 …
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…
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
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]
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…
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…
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…
Recursion · 4 marks · official answer ready
(c) Explain how a compiler makes use of a stack when translating recursive programming code. ......................................................................................…
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…
Algorithms · 2 marks · official answer ready
(b) Describe the purpose of both the A* algorithm and Dijkstra’s algorithm. .......................................................................................................…
Algorithms · 4 marks · official answer ready
(b) Identify two benefits and two drawbacks of quantum cryptography. Benefit 1 ....................................................................................................…
Recursion · 2 marks · official answer ready
12 (a) Describe what is meant by recursion. .......................................................................................................................................…
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 …
Algorithms · 2 marks · official answer ready
(b) Describe the purpose of both the A* algorithm and Dijkstra’s algorithm. .......................................................................................................…
Algorithms · 4 marks · official answer ready
(b) Identify two benefits and two drawbacks of quantum cryptography. Benefit 1 ....................................................................................................…
Recursion · 2 marks · official answer ready
12 (a) Describe what is meant by recursion. .......................................................................................................................................…
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 …
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 …
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]
