Concepts
The definitions of trees are as follows:
-
A tree is composed of one or more nodes.
-
A node has zero or more nodes as its children.
-
A node has zero or one node as its parent.
-
The node without parent is called the tree's root.
-
A node associates data of generic type, and data of all nodes in the same tree must be of the same type.
-
Children nodes preserve insertion order.
-
A forest is composed of zero or more nodes.
-
A node's children is a non-owning forest.
-
Two node's are siblings if their parents are the same node.