+1 vote
in Data Structures & Algorithms I by (88.2k points)
Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is ___________

(a) O(E)

(b) O(V*V)

(c) O(E+V)

(d) O(V)

The question is from Adjacency List in section Graph of Data Structures & Algorithms I

This question was posed to me in an interview for job.

1 Answer

+1 vote
by (737k points)
selected by
 
Best answer
The correct option is (c) O(E+V)

Easiest explanation - In an adjacency list for every vertex there is a linked list which have the values of the edges to which it is connected.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...