Re: Newbie



Hi Tadej,
Thanks for the reply. I been reading through the API and it looks good to me, but I have a few gaps remaining :)

1. I have to add another pointer to each of these nodes... do you suggest I add it to my data as part of the data struct?
2. Also I was wondering if I could please get some help being able to just dump out the contents of the tree in a readable format... so really just a print function for the tree... that would be really helpful and handy! :)

Cheers,
CBro

On Wed, Jun 16, 2010 at 2:48 PM, Tadej Borovšak <tadeboro gmail com> wrote:
Hello.

GNode is really a simple structure with 4 pointers to nodes (parent,
first child, previous and next sibling), which allow you move inside
tree, and one pointer to user data. You can store just about anything
inside user data pointer, but most applications store pointer to some
heap-allocated structure that holds real data.

I don't think there is a sample code specifically about GNode present
anywhere, since setting-up a tree is not much more difficult than
setting up a doubly-linked list.

Tadej

--
Tadej Borovšak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com



--

The greater danger for most of us lies not in setting our aim too high and falling short; but in setting our aim too low, and achieving our mark.
- Michelangelo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]