The following table shows the complexities of graphs:
Node/ Edge Management | Storage Size | Add Vertex | Add Edge | Remove Vertex | Remove Edge | Query |
Adjacency list | O (|V| + |E|) | O(1) | O(1) | O (|V| + |E|) | O(|E|) | O(|V|) |
Adjacency matrix | O(|V|2) | O(|V|2) | O(1) | O(|V|2) | O(1) | O(1) |