Computer Science 9608 · 9

9.2 Algorithms

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

Reset
2018 May-June · Paper 41 · Q2(a)

Algorithms · 7 marks · official answer ready

(a) Complete the pseudocode algorithm for a bubble sort. 01 MaxIndex 20 02 NumberItems ............................................................................................…

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

Algorithms · 2 marks · official answer ready

(i) Explain why the algorithm in part (a) is inefficient. .........................................................................................................................…

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

Algorithms · 3 marks · official answer ready

(ii) Explain how you would improve the efficiency of this algorithm. ..............................................................................................................…

2018 May-June · Paper 41 · Q2(c)

Algorithms · 4 marks · official answer ready

(c) An insertion sort is another sorting algorithm. State two situations when an insertion sort is more efficient than a bubble sort. Give a reason for each. Situation 1 .........…

2018 May-June · Paper 42 · Q3(c)(i)

Algorithms · 2 marks · official answer ready

(i) A binary search algorithm is used to find a specific value in an array. Explain why an array needs to be sorted before a binary search algorithm can be used. .................…

2018 May-June · Paper 43 · Q2(a)

Algorithms · 7 marks · official answer ready

(a) Complete the pseudocode algorithm for a bubble sort. 01 MaxIndex 20 02 NumberItems ............................................................................................…

2018 May-June · Paper 43 · Q2(b)(i)

Algorithms · 2 marks · official answer ready

(i) Explain why the algorithm in part (a) is inefficient. .........................................................................................................................…

2018 May-June · Paper 43 · Q2(b)(ii)

Algorithms · 3 marks · official answer ready

(ii) Explain how you would improve the efficiency of this algorithm. ..............................................................................................................…

2018 May-June · Paper 43 · Q2(c)

Algorithms · 4 marks · official answer ready

(c) An insertion sort is another sorting algorithm. State two situations when an insertion sort is more efficient than a bubble sort. Give a reason for each. Situation 1 .........…

2017 October-November · Paper 21 · Q2(c)

Algorithms · 10 marks · official answer ready

(c) Draw a program flowchart to represent this algorithm. Variable declarations are not required in program flowcharts. [10] 6

2017 October-November · Paper 22 · Q2(b)

Algorithms · 9 marks · official answer ready

(b) Draw a program flowchart to represent this algorithm. Note that variable declarations are not required in program flowcharts. [9] 8

2017 October-November · Paper 23 · Q2(c)

Algorithms · 10 marks · official answer ready

(c) Draw a program flowchart to represent this algorithm. Variable declarations are not required in program flowcharts. [10] 6

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

Algorithms · 7 marks · official answer ready

1 (a) Simple algorithms usually consist of three different stages. Complete the following table. Add a description of the stage and an example pseudocode statement. The first stag…

2017 May-June · Paper 21 · Q1(c)

Algorithms · 4 marks · official answer ready

(c) A common construct found in many algorithms is a loop. Using pseudocode, write a pre-condition loop to output all of the even numbers between 99 and 201. .....................…

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

Algorithms · 7 marks · official answer ready

1 (a) Simple algorithms usually consist of three different stages. Complete the following table. Add a description of the stage and an example pseudocode statement. The first stag…

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

Algorithms · 4 marks · official answer ready

(c) A common construct found in many algorithms is a loop. Using pseudocode, write a pre-condition loop to output all of the even numbers between 99 and 201. .....................…

2016 October-November · Paper 22 · Q1(a)

Algorithms · 9 marks · official answer ready

(a) Complete the following program flowchart by: • filling in the boxes, using pseudocode where appropriate • labelling the lines of the flowchart, where necessary. [9] 3 Start Ye…

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

Algorithms · 3 marks · official answer ready

(c) The programmer amends the design to validate the value of player game grade that the user inputs. The amended part of the flowchart is shown below. Loop OUPUT INPUT "Invalid –…

2016 October-November · Paper 31 · Q4(a)(ii)

Algorithms · 12 marks · official answer ready

(ii) State the name given to this logic circuit. ..................................................................................................................................…

2016 October-November · Paper 31 · Q4(a)(iii)

Algorithms · 15 marks · official answer ready

(iii) Name the labels usually given to A and B. Label A ...........................................................................................................................…