───✱*.。:。✱*.:。✧*.。✰*.:。✧*.。:。*.。✱ ───
An acyclic connected graph.
Rules
- Nodes are connected with edges
- Nodes can have child nodes
- The root node has no parent
- Leaf nodes have no children
- Nodes with children + parent are called non-terminal or internal nodes
Terms
- Parent → node “above” a node in hierarchy
- Child → node connects to another node moving away from the root
- Sibling → share the same parent
- Ancestor → any node that can be reached traveling toward root
- Descendant → any node that can be reached traveling away from root
- Height → length of the longest path from a node to a leaf node
- Depth → length from the root to a given node (number of vertices)
N-Ary Trees
- A tree with maximum number of nodes
- Binary tree → each node has at most two child nodes
- Perfect n-ary tree → every non-leaf node has exactly child nodes
───✱*.。:。✱*.:。✧*.。✰*.:。✧*.。:。*.。✱ ───