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.
eeraokvAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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!

http://www.bissey.net/
0
 
inprasCommented:
U can easily convert those examples to OO one
0
 
eeraokvAuthor Commented:
The struc generally has self refrential pointers to left, right and next nodes in a tree.
0
Never miss a deadline with monday.com

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

 
KangaRooCommented:
STL red black tree ;)
0
 
sbisseyCommented:
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.
0
 
dennismvCommented:
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.
0
All Courses

From novice to tech pro — start learning today.