Conceptual
Login

The Tree Data Structure and Its Node Hierarchy in Computer Science

A tree is a non-linear data structure defined as a collection of nodes linked together to simulate hierarchy, distinguished from linear collections such as arrays, linked lists, stacks, and queues by the absence of a single sequential ordering with one predecessor and one successor per element. It admits a recursive definition — a distinguished root node holding links to the roots of its subtrees — and satisfies the structural invariant that n nodes are connected by exactly n-1 directed edges, since every node except the root has precisely one incoming edge. The concept belongs to data structures in computer science, supplying the vocabulary (root, parent, child, sibling, leaf, internal node, ancestor, descendant), the metrics (depth and height), and the recursive property on which all tree algorithms and specialised tree variants are built.