tags:

views:

132

answers:

7
+2  Q: 

Tree Library for C

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

A: 

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.

BastiBense
actually I am modifying an open source C file and I don't want to translate that into C++ .......... so something for C would be better
Ravi Gupta
+2  A: 

Google shows me to GNU C Library. Are you looking for something more?

vpit3833
A: 

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

Fanatic23
The question explicitly states C and is tagged `c`.
dreamlax
A: 

Maybe also have a look at this Red-Black tree implementation (written in ANSI C):

Red-black trees

http://www.devzero.it/2009/06/red-black-trees/

ceeit
A: 

Have you tried codesearch?

Iulian Şerbănoiu
A: 

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.

Secure
A: 

There is a library called "libc": man tsearch :)

Dummy00001