Practice free →
HomeGATE CSEcomputerscienceAlgorithms › On a sparse graph (E far less than V²), the adja…

On a sparse graph (E far less than V²), the adjacency list representation

Awastes O(V²) bits regardless of edge count
Buses O(V + E) space, much less than O(V²)
Cis forbidden by the SQL standard
Dsupports only undirected graphs
Answer & Solution
Correct answer: B. uses O(V + E) space, much less than O(V²)
Adjacency lists store per-vertex neighbour lists, totalling O(V + E) cells. On sparse graphs this is far smaller than the matrix's fixed O(V²). Matrices waste rows of zeros for vertices with few neighbours. Lists handle both directed and undirected graphs; SQL has nothing to do with this choice.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions