Computer Science 9608 · 19

Computational thinking and problem-solving

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

2018 October-November · Paper 43 · 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 43 · Q4(c)(ii)

Recursion · 5 marks · official answer ready

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

2018 May-June · Paper 41 · Q6(b)

Recursion · 5 marks · official answer ready

(b) The linked list stores ListNode records in alphabetical order of player. The last node in the linked list always has a Pointer value of –1. The position of the first node in t…

2018 May-June · Paper 42 · Q2(d)

Recursion · 3 marks · official answer ready

(d) All iguanas and lizards are squamata. All squamata are reptiles. Write a recursive rule to make all lizards and iguanas inherit the properties of reptiles. has(X, Y) IF ......…

2018 May-June · Paper 42 · Q6(b)

Recursion · 8 marks · official answer ready

(b) A new command has been added to initialise the pointers of the binary tree to − 1 to indicate they are not in use. A leaf is a node of the binary tree which has no children. I…

2018 May-June · Paper 43 · Q6(b)

Recursion · 5 marks · official answer ready

(b) The linked list stores ListNode records in alphabetical order of player. The last node in the linked list always has a Pointer value of –1. The position of the first node in t…

2017 October-November · Paper 22 · Q1(c)

Recursion · 3 marks · official answer ready

(c) Functions and procedures are subroutines. Explain why parameters are used with subroutines. ...................................................................................…

2017 May-June · Paper 22 · Q1(a)

Algorithms · 0 marks · official answer ready

1 (a) Simple algorithms usually consist of input, process and output. The statements in the following table are in a generic programming language. Complete the table by placing ti…

2017 May-June · Paper 41 · Q3

Recursion · 7 marks · official answer ready

3 NameList is a 1D array that stores a sorted list of names. A programmer declares the array in pseudocode as follows: NameList : Array[0 : 100] OF STRING The programmer wants to …

2017 May-June · Paper 42 · Q2(e)

Recursion · 5 marks · official answer ready

(e) The traverse tree operation outputs the data items in alphabetical order. This can be written as a recursive solution. Complete the pseudocode for the recursive procedure Trav…

2017 May-June · Paper 43 · Q3

Recursion · 7 marks · official answer ready

3 NameList is a 1D array that stores a sorted list of names. A programmer declares the array in pseudocode as follows: NameList : Array[0 : 100] OF STRING The programmer wants to …

2016 October-November · Paper 31 · Q6(d)

Algorithms · 4 marks

6 0 0 135 0 0 When a particular page of the process is currently in main memory, the Presence flag entry in the page table is set to 1. If the page is not currently present in mem…

2016 October-November · Paper 33 · Q6(d)

Algorithms · 4 marks

6 0 0 135 0 0 When a particular page of the process is currently in main memory, the Presence flag entry in the page table is set to 1. If the page is not currently present in mem…

2016 May-June · Paper 41 · Q2(a)(ii)

Recursion · 1 mark · official answer ready

(ii) Write the line number from the pseudocode shown in part (b) that shows the procedure X is recursive. .............................. [1]

2016 May-June · Paper 41 · Q2(b)(i)

Recursion · 4 marks · official answer ready

(i) Complete the trace table for the dry-run of the pseudocode for the procedure CALL X(1, 9). MyList Index Item 1 2 3 4 5 6 7 8 9 10 [4]

2016 May-June · Paper 41 · Q2(b)(ii)

Recursion · 1 mark · official answer ready

(ii) State the purpose of procedure X when used with the array MyList. ............................................................................................................…

2016 May-June · Paper 42 · Q2(a)(ii)

Recursion · 1 mark · official answer ready

(ii) Write the line number from the pseudocode shown in part (b) that shows the procedure X is recursive. .............................. [1]

2016 May-June · Paper 42 · Q2(b)(i)

Recursion · 4 marks · official answer ready

(i) Complete the trace table for the dry-run of the pseudocode for the procedure CALL X(1, 9). MyList Index Item 1 2 3 4 5 6 7 8 9 10 [4]

2016 May-June · Paper 42 · Q2(b)(ii)

Recursion · 1 mark · official answer ready

(ii) State the purpose of procedure X when used with the array MyList. ............................................................................................................…

2016 May-June · Paper 43 · Q2(a)(ii)

Recursion · 1 mark · official answer ready

(ii) Write the line number from the pseudocode shown in part (b) that shows the procedure X is recursive. .............................. [1]