A graph is a set of vertices joined by edges. Edges can be one-way (directed) or two-way, and can carry weights such as distances. Almost any network, map or dependency structure is a graph.
- Typical operation
- O(V + E)
- Space
- O(V + E)
A graph is a set of vertices joined by edges. Edges can be one-way (directed) or two-way, and can carry weights such as distances. Almost any network, map or dependency structure is a graph.