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.

what-is-tree

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;

}

root-node-of-the-tree.


Comments

Popular posts from this blog

IMPLEMENTATION OF LRU PAGE REPLACEMENT ALGORITHM

IMPLEMENTATION OF FIFO PAGE REPLACEMENT ALGORITHM

PHP Array Functions