Mental Model
Shortest path means finding the quickest way between two points, but trees have only one path between nodes, while graphs can have many paths and loops.
Analogy: Imagine city streets: a tree is like a single straight road with no turns, but a graph is like a city map with many roads and intersections where you can choose different routes.
Tree: 1 -> 2 -> 3 -> null Graph: 1 -> 2 -> 3 ā ā 4 ā 5
