Graphs is used for representing relationships between entity. Graph theory provides languages to understand the relationship properties.
Trees are undirected graphs that are connected and acyclic.
Strategies
- Adjacency lists are the suitable data structure for most applications.
- Topological sorting is typically the first step to any algorithm on a DAG.