C Red Black Tree

Summary: in this tutorial, you will learn about red-black tree data structure and how to implement the red-black tree in C.

C Read Black TreeIntroduction to red-black tree data structure

A red-black tree is a special kind of the binary search tree where each tree’s node stores a color, which is either red or black. A red-black tree is a self-balancing binary search tree, in which the insert or remove operation is done intelligently to make sure that the tree is always balanced.

The complexity of any operation in the tree such as search, insert or delete is O(logN) where N is the number of nodes in the red-black tree.

The red-black tree data structure is used to implement associative arrays.

Red-black tree implementation in C

In this tutorial, you have learned how to implement red-black tree data structure in C.