Created by Marcell Alves
about 7 years ago
|
||
Question | Answer |
Faster to test if (x,y) is in graph? | Adjacency matrices |
Faster to find the degree of a vertex? | Adjacency lists |
Less memory on small graphs? | Adjacency lists (m + n) vs. (n²) |
Less memory on big graphs? | Adjacency matrices (a small win) |
Edge insertion or deletion? | Adjacency matrices O(1) vs. O(d) |
Faster to traverse the graph? | Adjacency lists θ(m + n) vs. θ(n²) |
Better for most problems? | Adjacency lists |
Want to create your own Flashcards for free with GoConqr? Learn more.