Re: General tree assignment in C



Ivica wrote:
It's hard to find any examples for general trees in C, just binary trees are around and that makes me a huge problem. :-\

?????

C is a very popular language. n-ary trees (which is what I think you
must mean by "general trees") are a common data structure. There are
surely C-language examples of them.

If nothing else, Linux is a kernel which supports filesystems like
you describe, which is written in C, and whose source is freely
available. So Linux probably provides an example of what you're
looking for (although it may be intermingled with some other code).

Second, to serve as a useful example, I don't see why you'd need to
look at an implementation that is already in C. An illustration in
just about any language should serve to illustrate the concepts
well enough.

And third, if you really understand what the data structure is
supposed to do, you should be able to implement it without looking
at any examples at all.

- Logan
.