An adjacency list is a list that tracks what’s adjacent to each node in a graph:
![Untitled](<https://s3-us-west-2.amazonaws.com/secure.notion-static.com/aff4fc6f-c884-4656-bcf9-7fcf86c3438b/Untitled.png>)
![Untitled](<https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3e0efe58-396d-4d0e-b184-e95e55771fd0/Untitled.png>)
![Untitled](<https://s3-us-west-2.amazonaws.com/secure.notion-static.com/124ecb8c-e5dd-4717-a23e-8a861c763596/Untitled.png>)
An adjacency matrix is a 2D matrix that stores a value for every possible pair of nodes in your graph. That value determines whether or not that pair of nodes points to each other.
array[i][j]
= true
or 1
, that means node i points to node j.array[j][i]
will be the same. ![Untitled](<https://s3-us-west-2.amazonaws.com/secure.notion-static.com/677a3c65-1c99-4235-9161-8d2ab051a576/Untitled.png>)
Properties