Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
CS foundations
/
Trees and graphs
Why does an adjacency list usually fit a sparse graph better than an adjacency matrix?
from Trees and graphs
Node 24
intermediate
1 min
Why does an adjacency list usually fit a sparse graph better than an adjacency matrix?
It stores existing neighbor relationships instead of allocating a cell for every vertex pair.
It guarantees that the graph contains no cycle.
It makes every weighted shortest-path query constant time.
It removes the need for stable vertex identities.
Check
Ask AI about this kata
Report an error
next kata
When does ordinary BFS provide a shortest-path guarantee?
Quiz
A new version is available
Reload