A tree consists of a finite set of elements, called nodes, and a finite set of directed lines, called branches, that connect the nodes. The number of branches associated with a node is the degree of the node. When the branch is directed toward the node, it is an indegree branch; when the branch is directed away from the node, it is an outdegree branch. The sum of the indegree and outdegree branches is the degree of the node.
If the tree is not empty, then the first node is called the root. The indegree of the root is, by definition, zero. With the exception of the root, all of the nodes in a tree must have an indegree of exactly one. All nodes in the tree can have zero, one, or more branches leaving them; that is, they may have an outdegree of zero, one, or more.
No comments:
Post a Comment