───✱*.。:。✱*.:。✧*.。✰*.:。✧*.。:。*.。✱ ───

An acyclic connected graph.

Rules

  • Nodes are connected with edges
  • Nodes can have 0 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

───✱*.。:。✱*.:。✧*.。✰*.:。✧*.。:。*.。✱ ───