[LAD] multi branch tree in c
jack.oquin at gmail.com
Fri Jul 11 03:03:50 UTC 2008
On Thu, Jul 10, 2008 at 5:39 PM, Julien Claassen <julien at c-lab.de> wrote:
> Hello again!
> I'm sorry, but my earlier experiments don't seem worth the effort. Now I
> thought, this has all been done and perhaps someone can help me. I need a tree
> stucture in C, based on struct, where each node has a list of subnodes. like
> If you get what I mean. Does anyone know of such a structure almost made
> ready for use? I'm sure I heard the official name for this in my lectures, but
> alas it's long ago.
> Yes, I did consider doing this in c++, but then readline will get me down on
> my knees again and will have my crying in frustration and defeat, as it did
> last time. :-(
The usual solution is a "node" struct for each element in the tree.
It normally has two pointers, one to the first child, and one to the next
sibling. A parent pointer may also be useful if you need to traverse the
tree starting somewhere other than the root. Leaf nodes have a NULL
More information about the Linux-audio-dev