Thread: Anyone know of any good (and free) implementations of a red-black tree?

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    1,619

    Anyone know of any good (and free) implementations of a red-black tree?

    I don't really feel like digging up my books of algorithms and coding my own red-black tree class, is there a good C++ implementation that anyone knows of?

    I had thought I still had a Java implementation I had coded in the past, but apparently, I don't.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Google to the rescue once again...


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    bit of a cheat but std::map is almost always a red-black tree
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Or std::set if the values are the keys.

    You can look at stlport if they use a red-black tree and install their library in order to be sure.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Thanks, but I ended up just coding my own. The only ones I found on Google weren't very robust (I wanted, and ended up coding, a template-based R/B tree).

    And the deletions/insertions weren't as bad as I recall them being, although they are some long functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Question about atheists
    By gcn_zelda in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 08-11-2003, 11:50 AM
  3. Other GOOD FREE compilers
    By DarkViper in forum C++ Programming
    Replies: 8
    Last Post: 12-07-2002, 09:16 PM
  4. Any good places for free source code?
    By VegasSte in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-19-2002, 04:22 AM