DEV Community

Mujahida Joynab
Mujahida Joynab

Posted on

Adjacency Matrix , When?

When to use Adjacency Matrix ?
-> If two nodes connected or not
TC - O(1)
If we do it by adjacency list or edge list we have to use loop . The complexity will become O(N) .

Top comments (0)