Final Tree
Final Tree
Tree (18M)
Visit for more Learning Resources
Data structure
Struct node
{
int data;
struct node * left,right;
};
Array Representation
1. To represent a tree in one dimensional array nodes are
marked sequentially from left to right start with root node.
2. First array location can be used to store no of nodes in a tree.
Linked Representation
1. This type of representation is more efficient as compared to array.
2. Left and right are pointer type fields left holds address of left child and right holds
address of right child.
3. Struct node
{
int data;
struct node * left,*right;
};
Binary Tree Types