Tree terminology

Many of the terms and definitions used in trees are unique to these data structures. Therefore, before we can examine tree data structures we need to take the time to learn the language.

Here are some of the most common and important terms:

  • Node: Any object or value stored in the tree represents a node. In the preceding figure, the root and all of its children and descendants are independent nodes.
  • Root: The root is the base node of the tree. Ironically, this node is typically depicted at the top of a graphic representation of the tree. Note that a root node, even if it has zero descendants, represents an entire tree by itself.
  • Parent: A parent node is any node which contains 1...n child nodes. The parent is only the parent in respect ...

Get Everyday Data Structures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.