A tree is a hierarchical data structure composed of nodes connected by edges. It models relationships where each item (node) may reference multiple sub-items (children), but cycles are not allowed. In computer science, we most often work with rooted trees, where one distinguished node is called the root and all edges conceptually point away from it.
Traversals visit nodes in a defined order. Common traversal names and orders are:
Precise terms enable clear reasoning about correctness, complexity, and implementation choices. Mastering these definitions is essential before studying specific tree types and algorithms.