Question 14
Back to Exercise
How much memory does an adjacency list need for a graph with V vertices and E edges?
- A O(V²)
- B O(V + E) Correct
- C O(E²)
- D O(V × E)
Correct Answer: Option B
One list per vertex plus one entry per edge (two for an undirected edge). A matrix needs O(V²).
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!