Member-only story
8 Useful Tree Data Structures Worth Knowing
An overview of 8 different tree data structures
What comes to your mind when you think of a tree? Roots, branches and leaves? A big oak tree with roots, branches and leaves may come to your mind. Similarly, in computer science, the tree data structure has roots, branches and leaves, but it is drawn upside-down. A tree is a hierarchical data structure which can represent relationships between different nodes. In this article, I will briefly introduce you to 8 types of tree data structures.
Properties of a Tree
- A tree can contain no nodes or it can contain one special node called the root with zero or more subtrees.
- Every edge of the tree is directly or indirectly originated from the root.
- Every child has only one parent, but one parent can have many children.
In this article, I will be briefly explaining the following 10 tree data structures with their usage.
- General tree
- Binary tree
- Binary search tree
- AVL tree
- Red-black tree
- Splay tree
- Treap
- B-tree