Recall & Review
beginner
What is a key difference between a tree and a graph?
A tree is a special type of graph with no cycles and exactly one path between any two nodes, while a graph can have cycles and multiple paths between nodes.
Click to reveal answer
beginner
Why can't shortest path problems be solved using trees alone?
Because shortest path problems often involve multiple paths and cycles, which trees do not have, so graphs are needed to represent all possible routes.
Click to reveal answer
intermediate
What does the presence of cycles in a graph imply for shortest path calculations?
Cycles mean there can be multiple routes between nodes, so algorithms must consider all paths to find the shortest one, which is not possible in trees since they have no cycles.
Click to reveal answer
beginner
How does a graph represent real-world networks better than a tree?
Graphs can represent complex connections with multiple paths and loops, like roads or internet networks, while trees only show hierarchical, one-path structures.
Click to reveal answer
beginner
Name a common algorithm used to find the shortest path in graphs.
Dijkstra's algorithm is a popular method to find the shortest path in weighted graphs.
Click to reveal answer
Which data structure allows multiple paths between nodes?
✗ Incorrect
Graphs can have multiple paths and cycles, unlike trees which have only one path between nodes.
Why is the shortest path problem not suited for trees?
✗ Incorrect
Trees have exactly one path between any two nodes, so shortest path problems that require multiple path options need graphs.
What feature of graphs makes shortest path algorithms necessary?
✗ Incorrect
Cycles and multiple paths in graphs require algorithms to find the shortest route.
Which algorithm is commonly used to find shortest paths in graphs?
✗ Incorrect
Dijkstra's algorithm efficiently finds shortest paths in weighted graphs.
In a tree, how many paths exist between two nodes?
✗ Incorrect
Trees have exactly one unique path between any two nodes.
Explain why shortest path problems require graphs instead of trees.
Think about how many ways you can travel between two points.
You got /3 concepts.
Describe how cycles in graphs affect shortest path calculations.
Consider what happens if you can go around in circles.
You got /3 concepts.