The implementation of the tree object above is inherently recursive. The binary tree, for example, is defined in terms of its left and right subtrees, which are trees in their own right.

General graphs, on the other hand, have no recursive structure that can be used in their implementation. Therefore, a graph must be implemented as a mere set of nodes and a set of edges issued from or directed to each node.