What are sparse and dense graphs, and how does density affect storage and algorithm performance?
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Other
Overview: Explain what makes a graph sparse or dense and how edge density changes the best way to store it and the running time of graph algorithms. Tests adjacency matrix and adjacency list trade-offs and how traversal, shortest-path and spanning-tree costs depend on the numbers of vertices and edges.