I want to store a general tree in C using parent pointer approach (a node store pointer to its parent node only). Is there any standard library for this?
Thanks in advance
I want to store a general tree in C using parent pointer approach (a node store pointer to its parent node only). Is there any standard library for this?
Thanks in advance
I'm not quite sure, but when having trees of data it might be more handy to use C++ for that as it allows you to easily build hierarchies of objects which all have pointers to their parents and children.
Google shows me to GNU C Library. Are you looking for something more?
If it is C++ and you need some library data structures to build and manipulate trees, definitely take a look into boost::graph documentation available from http://www.boost.org/doc/libs/1_43_0/libs/graph/doc/graph_concepts.html
Maybe also have a look at this Red-Black tree implementation (written in ANSI C):
Red-black trees
How about Ben Pfaff's libavl: http://www.stanford.edu/~blp/avl/
Granted, you will need some time to read the excellent documentation, but if you seriously want to work with trees, then it's well worth each single hour.