Tree Data Structure

Has anyone come across a good implementaion of a Tree in C++. Many are a extension to C version with struc as a private member in the class.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

sbisseyConnect With a Mentor Commented:
Here is the link to a tree implementation I did in C++ a year or two ago.  All the files are there to download.  The instruction are on the page.  When running it will be easiest if you create a text file that needs to be sorted.  It's a pretty sound program.  I'm pretty sure this will work for you.  I hope it does, I know how frustrating it can be to get working code for algorithms.  Good luck!
U can easily convert those examples to OO one
eeraokvAuthor Commented:
The struc generally has self refrential pointers to left, right and next nodes in a tree.
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

STL red black tree ;)
P.S. The tree is a binary tree, I can give you the code for Red/Black tree.  RBTrees are way to complicated however, not as complicated as AVL trees though what a nightmare.
note:  AVL complicated ?  Oh yeah.
It took me a whole week to write the deletion algorithm.  I got the insertion one from a book.

After that RBTrees are probably simpler, hehe :)
The thing is, once you know the algorithm, it's not as hard.
But tracking the algorithm is hard, most sites have bits and pieces, and to put it all together is somewhat wicked.
All Courses

From novice to tech pro — start learning today.