Tree in Data Structure
A tree is a data structure that represents hierarchical data. We define it as a collection of objects or entities known as nodes that are linked to represent or simulate hierarchy. It is also a non-linear structure, as it does not store the data sequentially.
Properties of a tree data structure:
- We know it to be a recursive data structure.
- The number of edges in the tree data structure is one less than the number of nodes.
- The depth of the node is equal to the length of the path from the root to the node.
- The height of the node is equal to the longest path from the specified node to the leaf node.
Implementation of the tree:
The tree data structure is created by creating the nodes with the help of pointers.
In programming it can be:

Types of trees:
There are five types of tree structures:
- General Tree
- Binary Tree
- Binary Search Tree
- AVL Tree
- Red-Black Tree
Reference