Question bank › A-level Computer Science › Fundamentals of data structures

Graphs (adjacency matrix and list)

Answer on paper first, then reveal the mark scheme one mark at a time.

1Standard5 marks

The diagram shows a weighted, undirected graph.

(a) The graph is to be stored as an adjacency matrix. Complete rows C, D and E of the matrix, using 0 where there is no edge. [2]

ABCDE
A04200
B405100
C
D
E

(b) Explain why an adjacency list might be more suitable than an adjacency matrix for storing a graph with many vertices but few edges. [2]

(c) Explain why this graph is not a tree. [1]

4251034ABCDE

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session