Question 3
OCR Computer Science June 2018 Paper 2A level27 marks
On the specification
- (a)(i)
- 1.4 Data types, data structures and algorithms
- (a)(ii)
- 2.1 Elements of computational thinking
- (a)(iii)
- 2.1 Elements of computational thinking
- (b)
- 2.3 Algorithms
- (c)
- 2.3 Algorithms2.2 Problem solving and programming
- (d)
- 2.2 Problem solving and programming3.3 Programming project: Developing the solution
Question text
3 A puzzle has multiple ways of reaching the end solution. Fig. 3 shows a graph that represents all possible routes to the solution. The starting point of the game is represented by A, the solution is represented by J. The other points in the graph are possible intermediary stages. Fig. 3 (a) The graph in Fig. 3 is a visualisation of the problem. (i) Identify one difference between a graph and a tree. [1] (ii) Explain how the graph is an abstraction of the problem. [2] (iii) Identify two advantages of using a visualisation such as the one shown in Fig. 3. 1 2 [2] (b) Demonstrate how Dijkstra’s algorithm would find the shortest path to the solution in Fig. 3. [7] (c)* The creator of the puzzle has been told that the A* algorithm is more efficient at finding the shortest path because it uses heuristics. Compare the performance of Dijkstra’s algorithm and the A* search algorithm, making reference to heuristics, to find the shortest path to the problem. [9] (d) A computer program version of the puzzle is to be developed. A programmer will use an IDE to debug the program during development. Describe three features of an IDE that help debug the program. 1 2 3 [6]