Recall & Review
beginner Click to reveal answer
What is the main structural difference between a graph and a tree?
A tree is a special type of graph that is connected and has no cycles. A graph can have cycles and may or may not be connected.
beginner Click to reveal answer
Can a tree have cycles? Why or why not?
No, a tree cannot have cycles because it must be acyclic to maintain a hierarchical structure where there is exactly one path between any two nodes.
beginner Click to reveal answer
Is it possible for a graph to be disconnected? Explain.
Yes, a graph can be disconnected, meaning it can have multiple separate parts with no path between some nodes.
beginner Click to reveal answer
What does it mean for a tree to be connected?
A tree is connected if there is exactly one path between any two nodes, meaning all nodes are reachable from the root.
beginner Click to reveal answer
How many edges does a tree with n nodes have?
A tree with n nodes always has exactly n-1 edges.
Which of the following is true about trees?
✗ Incorrect
Trees are connected and acyclic, so they have no cycles and exactly n-1 edges for n nodes.
What is a key difference between a graph and a tree?
✗ Incorrect
Trees are a special type of graph that are connected and have no cycles.
How many edges does a tree with 5 nodes have?
✗ Incorrect
A tree with n nodes has exactly n-1 edges, so 5 nodes means 4 edges.
Can a graph be disconnected?
✗ Incorrect
Graphs can be disconnected, meaning some nodes are not reachable from others.
Which property must a tree always have?
✗ Incorrect
A tree has exactly one path between any two nodes, ensuring no cycles and connectivity.
Explain the key structural differences between a graph and a tree.
Think about connectivity and cycles.
You got /5 concepts.
Describe why a tree cannot have cycles and what this means for its structure.
Consider how cycles affect paths between nodes.
You got /4 concepts.
