Sparse, node first, adjacency list
Space Complexity
-
for undirected graph(deprecated)
-
for directed graph
Node Time Complexity
This structure has very good performance for nodes
- Insert:
- Query:
- Removal:
- Count:
- Neighbors:
Edge Time Complexity
This structure has linear complexity across the edges
- Insert edge:
- Query edge:
- Removal edge:
- Count edges: