Computer Science For First Examination In 2021 9618 · 9

9.2 Algorithms

31 questions in this subtopic. Open a question to solve it and check the official answer.

Reset
2025 October-November · Paper 21 · Q2

Algorithms · 5 marks · official answer ready

2 Data is a global 1D array containing 30 elements of type STRING An algorithm will output: • all non-blank elements (elements that do not contain an empty string) • the final tot…

2025 October-November · Paper 21 · Q4(a)

Algorithms · 6 marks · official answer ready

(a) Complete the pseudocode for Store() All variables used in the algorithm must be declared. PROCEDURE Store() ...................................................................…

2025 October-November · Paper 22 · Q8(b)

Algorithms · 5 marks · official answer ready

(b) The pseudocode represents an algorithm to set the appropriate elements of the array to TRUE Complete the pseudocode: DECLARE EasyQ, HardQ : INTEGER FOR EasyQ .................…

2025 October-November · Paper 23 · Q2(a)

Algorithms · 6 marks · official answer ready

2 (a) A program contains a global 1D array of type STRING containing 65 elements. An existing text file is used to store the data in the array. Only non-blank elements (those that…

2025 May-June · Paper 23 · Q5(a)

Algorithms · 18 marks

(a) A text file Sales.txt stores strings representing the number of items sold. The file contains 52 lines, each representing the number of items sold in each week of the year. Fo…

2024 October-November · Paper 23 · Q2(a)

Algorithms · 5 marks · official answer ready

(a) Write pseudocode for the algorithm. Assume the value zero is neither positive nor negative. You must declare all variables used in the algorithm. .............................…

2024 October-November · Paper 23 · Q3(b)

Algorithms · 4 marks · official answer ready

(b) The array List will be initialised so that each node points to the following node. The last node will contain a null pointer. Complete the program flowchart to represent the a…

2024 October-November · Paper 23 · Q3(c)

Algorithms · 4 marks · official answer ready

(c) An algorithm outputs the Data field from all nodes in the array List. The order the Data is output should be the same order it is stored in the linked list. Describe the algor…

2024 May-June · Paper 22 · Q2(b)

Algorithms · 5 marks · official answer ready

(b) A different part of the program contains an algorithm represented by the following program flowchart: START Set Flag to GetStat() Is Flag = Yes TRUE ? No END Set Port to 1 No …

2024 May-June · Paper 23 · Q1(a)(i)

Algorithms · 2 marks · official answer ready

(i) State two benefits of this modification to the existing program. 1 ............................................................................................................…

2024 May-June · Paper 31 · Q10(c)

Algorithms · 2 marks · official answer ready

(c) Describe the performance of a binary search in relation to the number of data items in the array being searched. Refer to Big O notation in your answer. ......................…

2024 May-June · Paper 32 · Q8

Algorithms · 8 marks

8 (a) Complete the pseudocode to find an item in a 1D array Widgets of type STRING, using a linear search. DECLARE Widgets : ARRAY[1:50000] OF STRING DECLARE TopOfList : INTEGER D…

2024 May-June · Paper 32 · Q8(b)

Algorithms · 8 marks · official answer ready

8 (a) Complete the pseudocode to find an item in a 1D array Widgets of type STRING, using a linear search. DECLARE Widgets : ARRAY[1:50000] OF STRING DECLARE TopOfList : INTEGER D…

2024 May-June · Paper 33 · Q10(c)

Algorithms · 2 marks · official answer ready

(c) Describe the performance of a binary search in relation to the number of data items in the array being searched. Refer to Big O notation in your answer. ......................…

2023 October-November · Paper 22 · Q2(a)

Algorithms · 5 marks · official answer ready

(a) Draw a program flowchart to represent the algorithm. START END [5] 5

2023 October-November · Paper 23 · Q2(a)

Algorithms · 5 marks · official answer ready

(a) An algorithm will output the index of the element with the smallest value. Draw a program flowchart to represent the algorithm. START END [5] 5

2023 May-June · Paper 23 · Q1(c)

Algorithms · 1 mark · official answer ready

(c) The pseudocode does not include a declaration for PCount. State the data type that should be used in the declaration. .........................................................…

2023 May-June · Paper 23 · Q3(b)(ii)

Algorithms · 5 marks · official answer ready

(ii) A module SaveStack() will write the data from the stack to a text file. Express an algorithm for SaveStack() as five steps that could be used to produce pseudocode. Write the…

2022 October-November · Paper 22 · Q2(a)(i)

Algorithms · 5 marks · official answer ready

(i) Describe the steps that the algorithm should perform. Do not include pseudocode statements in your answer. ....................................................................…

2022 October-November · Paper 22 · Q4(a)

Algorithms · 6 marks · official answer ready

(a) Write the equivalent pseudocode for the algorithm represented by the flowchart. ...............................................................................................…