Computer Science EngineeringHard

An adjacency matrix representation of a graph with V vertices needs space

  1. A. Theta(V + E)
  2. B. Theta(V^2)
  3. C. Theta(E)
  4. D. Theta(V log V)

Correct answer: B. Theta(V^2)

It stores one entry for every ordered vertex pair regardless of the number of edges.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic