Computer Science 9608 · 19

Computational thinking and problem-solving

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

2021 May-June · Paper 23 · Q1(a)

Algorithms · 5 marks · official answer ready

1 (a) Algorithms usually consist of three different types of activity. Complete the following table. Write each example statement in program code and state the programming languag…

2021 May-June · Paper 41 · Q3(c)

Algorithms · 3 marks · official answer ready

(c) Explain the benefits of the team using program libraries in the development of the program. ...................................................................................…

2021 May-June · Paper 41 · Q4(b)(iii)

Recursion · 6 marks · official answer ready

(iii) A pre-order traversal on the following tree would output M C A G R L W M C R A G L W The pre-order traversal can be written as a recursive procedure: 1. output the root node…

2021 May-June · Paper 41 · Q5(b)

Recursion · 5 marks · official answer ready

(b) The binary search algorithm can be written recursively. Write program code for a recursive function recursiveBinarySearch(). Programming language .............................…

2021 May-June · Paper 43 · Q3(c)

Algorithms · 3 marks · official answer ready

(c) Explain the benefits of the team using program libraries in the development of the program. ...................................................................................…

2021 May-June · Paper 43 · Q4(b)(iii)

Recursion · 6 marks · official answer ready

(iii) A pre-order traversal on the following tree would output M C A G R L W M C R A G L W The pre-order traversal can be written as a recursive procedure: 1. output the root node…

2021 May-June · Paper 43 · Q5(b)

Recursion · 5 marks · official answer ready

(b) The binary search algorithm can be written recursively. Write program code for a recursive function recursiveBinarySearch(). Programming language .............................…

2019 May-June · Paper 41 · Q3(a)

Recursion · 2 marks

(a) State two features of recursion. Feature 1 ................................................................................................................................... …

2019 May-June · Paper 41 · Q3(b)

Recursion · 3 marks

(b) Explain what a compiler has to do to implement recursion. .....................................................................................................................…

2019 May-June · Paper 43 · Q3(a)

Recursion · 2 marks

(a) State two features of recursion. Feature 1 ................................................................................................................................... …

2019 May-June · Paper 43 · Q3(b)

Recursion · 3 marks

(b) Explain what a compiler has to do to implement recursion. .....................................................................................................................…

2018 October-November · Paper 41 · Q4(a)(i)

Recursion · 1 mark · official answer ready

(i) State what is meant by a recursive algorithm. .................................................................................................................................…

2018 October-November · Paper 41 · Q4(a)(ii)

Recursion · 1 mark · official answer ready

(ii) State the line number in Calculate() where the recursive call takes place. ...................................................................................................…

2018 October-November · Paper 41 · Q4(b)

Recursion · 6 marks · official answer ready

(b) The function is called with Calculate(3). Dry run the function and complete the trace table below. State the final value returned. Show your working. 01 FUNCTION Calculate(BYV…

2018 October-November · Paper 41 · Q4(c)(i)

Recursion · 2 marks · official answer ready

(i) Describe one problem that can occur when running a subroutine that has a recursive algorithm. .................................................................................…

2018 October-November · Paper 41 · Q4(c)(ii)

Recursion · 5 marks · official answer ready

(ii) Rewrite the Calculate() function in pseudocode, using an iterative algorithm. ................................................................................................…

2018 October-November · Paper 42 · Q6(b)

Recursion · 5 marks · official answer ready

(b) The program stores the position of the last node in the linked list in LastNode. The last node always has a Pointer value of -1. The position of the node at the head of the li…

2018 October-November · Paper 43 · Q4(a)(i)

Recursion · 1 mark · official answer ready

(i) State what is meant by a recursive algorithm. .................................................................................................................................…

2018 October-November · Paper 43 · Q4(a)(ii)

Recursion · 1 mark · official answer ready

(ii) State the line number in Calculate() where the recursive call takes place. ...................................................................................................…

2018 October-November · Paper 43 · Q4(b)

Recursion · 6 marks · official answer ready

(b) The function is called with Calculate(3). Dry run the function and complete the trace table below. State the final value returned. Show your working. 01 FUNCTION Calculate(BYV…