Posted by Jerry Stuckle on 07/11/07 01:43
PaowZ wrote:
> Hi there!
>
> I'm facing an issue concerning tree data structure in php.
> In others languages, I just need to create a root node which I bind
> pointers of instances representing others nodes.
> But I couldn't find a way to do so in php language. Indeed, object
> instances are "volatile" reaching the end of the script. How could I
> build a tree with "volatile" address pointers in php ?
> I could use arrays to store data like a tree structure but I'd like to
> find another way..
>
> do you have any suggestions ?
>
> thanks a lot :)
>
Well, can emulate a C/C++ structure with a class; I've created AVL trees
that way and it works well.
You don't use pointers in PHP; just clone the new node and place it in
the appropriate root.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|