I am new to graph data structure. Everywhere on google it is said to be list(or array ) of linked list. My question is can not it be represented as list of list(in java array list of array list) or map of list(in java HashMap with key as node and value as array list of connected node ) ?
In all three mentioned approach I see time complexity
To find if two nodes are connected - O(v) To find all connected nodes - O(v)
Also space complexity will also be more or less same .
So why Adjacency List is said to be list(or array ) of linked list not as list of list or map of list ?