On Wed, 26 Jan 2005, Eric Bambach wrote:

> On Wednesday 26 January 2005 05:01 pm, J. wrote:
> > Wednesday, January 26

> > I guess there is something wrong in my reasoning about this...
> 
> Yea, that definatly wont work. I think you're messing up because a recursive 
> function can only pass back the top node, or a node that meets a certain 
> condition back up the calling stack, without static data, you cant call a 
> recursive function and keep going where it left off so you can only return 
> one node.

Aha, of course momement here ! ;-)
 
> Why dont you just pass a function pointer into the recursive function so it 
> looks like this:(pseudocode, my function pointer syntax is bad)

Thnkx...

I slept a night over it and decided that it was way more effecient for my
program to keep an shadow array of pointers to each node in the tree.
That way it's easy sorting, iter etc.. And it works without a large mem
increase.

Thnkx again.. for the answer.

J.

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to