Skip to content
← Back to glossary

2分木Binary tree

Learn in the textbookFundamentals of Data Structures

DefinitionA binary tree (2分木) is a tree structure in which each node has at most two children, a left child and a right child.

ExplanationThe left and right children are treated as distinct, and a node may have just one child or none at all, as a leaf does. If values are stored by sending smaller ones to one side and larger ones to the other, for instance, fewer nodes need to be visited when searching for a target value.

AnalogyThink of a yes/no quiz chart. Each question leads on in at most two directions, yes and no; some questions continue on only one side, and some end there with a result.

Memory hook"Binary" means two: picture a branch that forks into two.