Data Structures (Trees Introduction)
Introduction to Tree in Data Structures
π The tree is a nonlinear hierarchical data structure and comprises a collection of entities known as nodes.
π It connects each node in the tree data structure using "edges”, both directed and undirected.
π The image below represents the tree data structure. The blue-colored circles depict the nodes of the tree and the black lines connecting each node with another are called edges.
Tree Node:
π node is a structure that contains a key or value and pointers in its child node in the tree data structure.
π In the tree data structure, you can define the tree node as follows.
struct node { int data; struct node *leftchild; struct node *rightchild; } |
Comments
Post a Comment