Introduction
A tree is a nonlinear hierarchical data structure that consists of nodes connected by edges.
There are different types of tree data structures, such as:
- General tree
- Binary tree
- Balanced tree
- Binary search tree
Advantages
- Provides a hierarchical way of storing data.
- Allows storage of many nodes.
- Allows insertion, deletion and searching operations that yield results faster than an array or linked list.
Disadvantages
- Some trees can only be stored using sequential or chained storage.