36
Storage cost:
O(V
2
)
If the graph is sparse, most storage is wasted.
Cost of operations:
initialisation:
O(V
2
)
(initialise
V×V
matrix)
insert edge:
O(1)
(set two cells in matrix)
delete edge:
O(1)
(unset two cells in matrix)