Quick Facts

  • Array of Linked Lists
  • Array size equal to number of vertices.
  • Each index in array corresponds to linked list with vertices connecting to the vertex at this index.

Pros:

  • Saves space \(O( |V| + |E| )\), worst case \(O( V^2 )\)
  • Adding a vertex is easier.

Cons:

  • Checking whether an edge exists between two vertices takes \(O( V )\) time.

References

Leave a Reply