Recall & Review
beginner
What is a key limitation of trees that graphs overcome?
Trees cannot model relationships where nodes have multiple parents or cycles. Graphs can represent these complex connections.
Click to reveal answer
beginner
Why do graphs exist in data structures?
Graphs exist to represent complex relationships like networks, where connections can be many-to-many and cycles can occur, which trees cannot model.
Click to reveal answer
intermediate
Explain with an example a situation where a tree structure fails but a graph works.
In a social network, a person can have many friends (multiple parents), and friendships can form cycles. Trees cannot represent this, but graphs can.
Click to reveal answer
beginner
What does it mean when we say trees are 'acyclic' and graphs can have 'cycles'?
Trees have no loops; you cannot start at one node and return to it by following edges. Graphs can have cycles, meaning loops are allowed.
Click to reveal answer
intermediate
Can a tree be considered a special type of graph? Why or why not?
Yes, a tree is a special kind of graph that is connected and has no cycles. But not all graphs are trees because graphs can have cycles and multiple connections.
Click to reveal answer
Which structure can represent multiple parents for a single node?
✗ Incorrect
Graphs allow nodes to have multiple parents or connections; trees do not.
What is a key feature that trees do NOT have but graphs can have?
✗ Incorrect
Trees are acyclic, meaning they cannot have cycles; graphs can have cycles.
Why can't trees model social networks well?
✗ Incorrect
Social networks have complex connections and cycles, which trees cannot represent.
Which of these is true about trees?
✗ Incorrect
Trees have exactly one path between any two nodes because they are connected and acyclic.
Graphs are used when:
✗ Incorrect
Graphs model complex relationships including cycles and multiple connections.
Explain why trees cannot model certain real-world relationships and how graphs solve this problem.
Think about social networks or road maps.
You got /4 concepts.
Describe the main differences between trees and graphs in terms of structure and use cases.
Consider hierarchy vs network.
You got /4 concepts.