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 ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.