AQA 7517 — Paper 1 Style
A graph has vertices: A, B, C, D, E with edges: A-B, A-C, B-D, C-D, D-E.
(a) State the data structure used by a Breadth-First Search. [1]
(b) Starting from A, give the order nodes are visited using BFS. [2]
(c) Give ONE reason why BFS would be preferred over DFS to find the shortest route between two nodes. [1]
[4 marks]
2 marks
(b) A, B, C, D, E (level by level: A→{B,C}→{D}→{E})
1 mark
(c) BFS guarantees shortest path in an unweighted graph; DFS may find a longer path