the.com/binary tree
a family tree where every parent stops at two kids, no exceptions, no favorites.
means a data structure where each node points to at most two children, called left and right.
from formalized in computer science in the 1950s-60s alongside early sorting and search algorithms, though the branching idea traces back to tree diagrams used in logic and taxonomy for centuries.
height mattersa balanced tree of n nodes has log n height
worst casean unbalanced tree degrades into a plain list
traversal ordersinorder, preorder, postorder give three different readings
node limiteach node has exactly zero, one, or two children
for instance
binary search tree — keeps left smaller, right bigger, for fast lookup
heap — array-backed binary tree powering priority queues since the 1960s
huffman tree — builds optimal compression codes, used in zip and jpeg
decision tree — splits data by yes-no questions in machine learning