9.2 Algorithms
31 questions in this subtopic. Open a question to solve it and check the official answer.
Algorithms · 1 mark · official answer ready
(b) Give the name of the iterative construct in the flowchart. ....................................................................................................................…
Algorithms · 8 marks · official answer ready
(b) Write an efficient bubble sort algorithm in pseudocode for module SortArrays(). ...............................................................................................…
Algorithms · 6 marks · official answer ready
12 (a) The array Names[0:99] is in alphabetical order. Complete this pseudocode binary search algorithm. Lower ←0 .................................................................…
Algorithms · 1 mark · official answer ready
(i) State the Big O notation for time complexity of a linear search. ..............................................................................................................…
Algorithms · 2 marks · official answer ready
(ii) Describe the meaning of O(log n) as it applies to a binary search algorithm. .................................................................................................…
Algorithms · 6 marks · official answer ready
2 (a) An algorithm to sort a 1D array into ascending order is described as follows: • move the largest value to the end • keep repeating until the array is sorted. Apply the proce…
Algorithms · 6 marks · official answer ready
(b) The program flowchart shown describes a simple algorithm. START Set Count to 1 Set Flag to FALSE Is Flag = YES FALSE AND Count
Algorithms · 2 marks · official answer ready
(b) Describe a feature of your solution to part (a) that indicates the pseudocode represents an efficient algorithm. ..............................................................…
Algorithms · 8 marks · official answer ready
5 A global 2D array Result of type INTEGER is used to store a list of exam candidate numbers together with their marks. The array contains 2000 elements, organised as 1000 rows an…
Algorithms · 6 marks · official answer ready
(c) The following bubble sort pseudocode algorithm sorts the data in theArray into descending numerical order. There are five incomplete statements. PROCEDURE bubbleSort() DECLARE…
Algorithms · 6 marks · official answer ready
(c) The following bubble sort pseudocode algorithm sorts the data in theArray into descending numerical order. There are five incomplete statements. PROCEDURE bubbleSort() DECLARE…
