LearnFrenzy
Sign in Take a free test

Data Structures in Java · Data Structures in Java MCQ · Question 14

Memory used by an adjacency list Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links