The following C++ code will explains the implementation of Binary Search Tree. The following implementation is inobject oriented using theTree class and tree object. The implemented ADT functions of Binary Search Treeare insert and search.
Introduction to Tree Tree is used in data structure. A tree is used for quick search and can store unordered data.
A tree diagram is a useful tool to list all the logical possibilities of a sequence of events where each event can occur in a finite number of ways.
A tree consists of a root, a number of branches leaving the root, and possible additional branches leaving the end points of other branches. A tree is normally constructed from left to right. A vertex of degree 1 in a tree is called a terminal vertex or a leaf node and a vertex of degree greater than 1 in a tree is called an internal vertex or a branch. The nodes at the lowest levels of the tree (the ones with no sub-trees) are called leaves.