Question 5

OCR Computer Science June 2022 Algorithms and programming (H446-02)A level14 marks

On the specification

(a)(i)
1.4 Data types, data structures and algorithms
(a)(ii)
1.4 Data types, data structures and algorithms
(b)
2.1 Elements of computational thinking
(c)(i)
2.3 Algorithms
(c)(ii)
2.3 Algorithms
(d)(i)
3.2 Programming project: Design of the solution
(d)(ii)
3.2 Programming project: Design of the solution
Question text

5 Fig. 5 shows a graph data structure representing a small section of a parcel delivery network. Each node represents an address where deliveries need to be made. The edges show the possible routes and distances between these deliveries. D H 11 7 33 B C G 33 7 7 A E 3 F Fig. 5 (a) (i) State one way a directed graph is different to an undirected graph. [1] (ii) State one way a graph data structure is different to a tree data structure. [1] (b) Give one reason why the graph is a visualisation of the problem. [1] (c) (i) Show how Dijkstra’s algorithm can be used on the graph shown in Fig. 5 to find the shortest path from the start node A and the end node H. You should state the nodes on the final path and the overall distance. Show your working. You may choose to use the table below to give your answer. Node Distance travelled Previous node Final path: Distance: [6] (ii) Give a similarity and difference between the performance of Dijkstra’s algorithm and the performance of A* algorithm. Similarity Difference [2] (d) (i) State why performance modelling is used to test a system. [1] (ii) Describe how performance modelling can be used in the delivery system. [2]