Question 7
OCR Computer Science June 2023 Algorithms and programming (H446-02)A level26 marks
On the specification
- (a)
- 2.3 Algorithms
- (b)(i)
- 2.1 Elements of computational thinking
- (b)(ii)
- 2.1 Elements of computational thinking
- (c)(i)
- 2.3 Algorithms
- (c)(ii)
- 2.3 Algorithms
- (d)
- 2.2 Problem solving and programming
Question text
7* (a) A program designer needs to decide on an algorithm to use from a choice of three. The table shows the worst-case Big O complexities for each algorithm. Algorithm Time Complexity Space Complexity 1 Linear Exponential 2 Exponential Constant 3 Logarithmic Logarithmic The program will be used to analyse data that can range from 2 items to 2 billion items. Compare the use of all three algorithms and suggest which the programmer should use. You should include the following in your answer: • the meaning of constant, logarithmic, linear and exponential complexity • how well each algorithm scales as the amount of data increases • which algorithm is the most suitable for the given task. [9] (b) The program designer is investigating the use of concurrent processing. (i) Describe what is meant by the term ‘concurrent processing’. [2] (ii) Give two benefits of using concurrent processing. 1 2 [2] (c) The programmer needs to use a merge sort in one part of the problem to sort items in ascending order. (i) Describe how a merge sort works. [5] (ii) Give one benefit and one drawback of the programmer using a merge sort instead of a bubble sort. Benefit Drawback [2] (d) The programmer uses an Integrated Development Environment (IDE). Complete the table by identifying and describing three IDE features that can help the programmer to develop, or debug a program. IDE feature Description [6]