Re: [gtk-list] Re: GLIB's N-ary trees



> > Ah, so a GNode is not a BTree because it doesn't do any kind of
> > balancing.
[...]
> The GTree is allready able to auto-balance (have a small look in
> gtree.c : g_tree_insert() actually calls the g_tree_node_insert()
> static - and this one calls g_tree_node_balance() if needed).
> So you don't have to build your own Btree.

	I need a tree that has more than two children per node.  As far as
I can tell, GTree will only work as a binary tree, not a BTree (although I
admit I have not looked at the source very thoroughly).

	Assuming GTree is using Red/Black to do its balancing, I could
probably just adapt the GTree code to have multiple children.  I haven't
had time to look at it closely yet...


--Derek



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