Member-only story

8 Useful Tree Data Structures Worth Knowing

An overview of 8 different tree data structures

Vijini Mallawaarachchi
TDS Archive
6 min readMar 11, 2020

--

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.
Fig 1. Terminology of trees

In this article, I will be briefly explaining the following 10 tree data structures with their usage.

  1. General tree
  2. Binary tree
  3. Binary search tree
  4. AVL tree
  5. Red-black tree
  6. Splay tree
  7. Treap
  8. B-tree

1. General Tree

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Vijini Mallawaarachchi
Vijini Mallawaarachchi

Written by Vijini Mallawaarachchi

Bioinformatician | Computational Genomics 🧬 | Data Science 👩🏻‍💻 | Music 🎵 | Astronomy 🔭 | Travel 🎒 | vijinimallawaarachchi.com

Responses (2)