Last reviewed
Correct answer: C. A tree is hierarchical with a single root and no cycles
Explanation
In graph terms a tree is a connected, undirected, acyclic graph, rooted and ordered unless stated otherwise. Connected means a path exists between every pair of vertices; acyclic means no path returns to its own start; together they force exactly one path between any two nodes and exactly n minus one edges across n nodes. A general graph promises none of this. It may be disconnected, it may loop, and two vertices may be joined by many distinct paths.
The difference shows up the moment code walks the structure. A recursive walk over a tree needs no visited set, because there is no way back to a node already left; run that same code over a graph and one cycle turns it into an endless descent. Every tree is a graph, and the reverse does not hold.
Two of the wrong answers invert real facts. A tree is not confined to a single node; it holds any number and may even be empty. And a tree does not carry more edges than a graph, since n minus one is the fewest edges a connected structure can have.
Sources
“A connected, undirected, acyclic graph. It is rooted and ordered unless otherwise specified.”
“Graphs are so general that many other data structures, such as trees, are just special kinds of graphs.”
“An undirected graph that has a path between every pair of vertices.”
Practise 3 questions on this topic
Take Trees & Graphs — Timed Test (3 questions) — scored instantly, explanation for every question, no login.