There are several ways to represent tree structure. We will use graph to represent tree in which every node will be represented by circle and a line from one node to other is called edge.
In tree every node has three fields, first represent the data while second & third keep the information of left & right child of node.
Node Edge Prepared by: Shumaila Bashir Sheikh(Lecturer, ITC) A B D E C F
A node may contain a value or a condition or represent a separate data structure or a tree of its own. Each node in a tree has zero or more child nodes , which are below it in the tree.
Binary Search Tree: A binary search tree is a binary tree in which each node has value greater than every node of left sub-tree and less than every node of right sub-tree.
Be the first to comment