A hierarchical, non-linear data structure in which each node has at most two children, referred to as the left child and the right child.

Terminology

  • Node: A single element within the tree that stores data and references (pointers) to its children.
  • Root: The topmost node in the tree, which has no parent.
  • Leaf: A node at the bottom of the tree that has no children.
  • Parent/Internal Node: A node that has one or two child nodes.
  • Edge: The link or connection between a parent node and its child node.
  • Subtree: A portion of the tree consisting of a node and all its descendants.
  • Height: The length of the longest path (number of edges) from the root to a leaf node.
  • Depth/Level: The number of edges from the root to a specific node.