Trees are one of the fundamental [[data structure]]s of [[computer science]], along with the [[array]], the [[index]], and the [[look-up table]]. The '''binary tree''' is the simplest, and most commonly used, form of tree. The primary distinguishing feature of a tree data structure is that it is tree-shaped (if balanced). All tree structures contain nodes which contain data, and links from the node to other nodes. The relative position of the nodes to each other based on the links means that the tree's data can be retrieved in an ordered fashion if the proper traversal method is used. A binary tree differs from other trees (such as a B3 tree) in that each node only has two links to other nodes. By convention, these links are called the '''left''' and '''right''' links. Data sorted before a node is inserted into the tree via the left link of that node, while data that sorts after is inserted into the tree via the right link. | Trees are one of the fundamental [[data structure]]s of [[computer science]], along with the [[array]], the [[index]], and the [[look-up table]]. The '''binary tree''' is the simplest, and most commonly used, form of tree. The primary distinguishing feature of a tree data structure is that it is tree-shaped (if balanced). All tree structures contain nodes which contain data, and links from the node to other nodes. The relative position of the nodes to each other based on the links means that the tree's data can be retrieved in an ordered fashion if the proper traversal method is used. A binary tree differs from other trees (such as a B3 tree) in that each node only has two links to other nodes. By convention, these links are called the '''left''' and '''right''' links. Data sorted before a node is inserted into the tree via the left link of that node, while data that sorts after is inserted into the tree via the right link. |