When you use graphs vs when to use trees for data structures?
Trees are Graphs.
They are specifically directed, acyclic graphs where all child nodes only have one parent. If you need more than one parent then you use a DAG. If you need cycles or the graph needs to be undirected you’d use some kind of graph implementation. Note that the time and space complexity increases dramatically once you move into full graphs.
2