Pages

Showing posts with label binary search tree. Show all posts
Showing posts with label binary search tree. Show all posts

Wednesday, August 03, 2011

Binary Search Tree - Code


Binary Search Tree
The following C++ code will explains the implementation of Binary Search Tree.
The following implementation is in object oriented using the Tree class and tree object
The implemented ADT functions of Binary Search Tree are insert and search.


Wednesday, June 22, 2011

Binary Search Tree


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.