Section 21.7 Trees
• A tree is a nonlinear, two-dimensional data structure. Tree nodes contain two or more links.
• A binary tree (p. 893) is a tree whose nodes all contain two links. The root node (p. 893) is the first node in a tree.
• Each link in the root node refers to a child (p. 893). The left child (p. 893) is the first node in the left subtree (p. 893), and the right child (p. 893) is the first node in the right subtree (p. 893).
• The children of a node are called siblings (p. 893). A node with no children is a leaf node (p. 893).
• In a binary search tree (p. 894) with no duplicate values, the values in any left subtree are less than the value in the subtree’s parent node, and the values in any right subtree are greater than the value ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access