pike.git / src / rbtree.h

version» Context lines:

pike.git/src/rbtree.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: rbtree.h,v 1.8 2002/10/11 01:39:37 nilsson Exp $ + || $Id: rbtree.h,v 1.9 2007/05/07 15:27:27 mast Exp $   */      /* An implementation of a threaded red/black balanced binary tree.    *    * Created 2001-04-27 by Martin Stjernholm    */      #ifndef RBTREE_H   #define RBTREE_H      /* #define RB_STATS */      #include "array.h"      /* A red/black tree is a binary tree with one extra bit of info in -  * each node - the color of it. The following properties holds: +  * each node - the color of it. The following properties hold:    *    * o Every node is either red or black.    * o A NULL leaf is considered black.    * o If a node is red, its children must be black.    * o Every path from a node down to all its leafs have the same    * number of black nodes.    * o The root node is always black (by convention).    *    * The longest possible path in a given tree thus has alternating red    * and black nodes, and the shortest possible path in it has only