Overview of different types of tree

There are different types of tree data structures, each one with their own benefits and implementations. We are going to have a quick look over the most common ones so we can gain a good overview of the different types and choose which one to use in each case wisely.

After the following introduction to the different types of trees, we will go deeper into the details, properties, uses, and implementations.

Binary tree

This is the most basic type of tree to start with. A binary tree is a tree data structure in which any node has at most two children.

In a binary tree, the data structure needs to store values and references inside each node, contain a value key, and potentially, a reference to the parent (except the ...

Get Swift Data Structure and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.