1.

Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is __________(a) O(V)(b) O(E*E)(c) O(E)(d) O(E+V)Enquiry is from Adjacency List topic in portion Graph of Data Structures & Algorithms IThe question was posed to me at a job interview.

Answer»

Right answer is (c) O(E)

The best 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.



Discussion

No Comment Found

Related InterviewSolutions