On 06/22/2011 03:06 PM, Simon J Welsh wrote:
> On further inspection, that's not the problem at all. The problem's around 
> assign_children($pid,$list,&$new);
> 
> The previous line you defined $new with $new = $leaf[$pid], *copying* that 
> node into $new. Thus the assign_children() call updates $new, but not 
> $lead[$pid].
> 
> You can fix this by either assigning $new by reference ($new =& $leaf[$pid]) 
> or by passing a reference to $lead[$pid] to assign_children instead of $new.

I updated the code:

http://www.perturb.org/tmp/tree.txt

I still get the same output though. Only one level of depth :(

-- 
Scott Baker - Canby Telcom
System Administrator - RHCE - 503.266.8253

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to