This is some code for red-black trees and interval trees in C++. Originally by Emin Martinian.