Emin's Page

Red-Black Tree C Code


The following C files implement balanced binary trees using the red-black paradigm. I have written these functions in a very general manner so that the key can be anything at all. Each node of the balanced binary tree must contain a key and a pointer to info. The user defines what data-type the key is and provides a comparison function for the keys. The info can also be any kind of data type. You might also want to take a look at the C++ version of red black trees and interval trees.

You can either download everything as a gzipped tar file or download them separately below:

In addition, Gokce Toykuyu kindly translated these to PHP: