Medium

Adjacency Matrix

A V by V table marks whether an edge exists. The check is direct. The table is large even when almost no edges exist.

Costs

CategoryData Structure
DifficultyMedium
Check one edgeO(1)
List the neighbors of vO(V)
MemoryO(V²)

Questions

What is Adjacency Matrix?

A V by V table marks whether an edge exists. The check is direct. The table is large even when almost no edges exist.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.