[Need] Binary Tree by PHP & MySQL
Started on the old forum in September 2013 · view the original in the archive · old links redirect here
Maybe some more info is required to answer this question as its not making much sense for what you need help with
something else wrote: Maybe some more info is required to answer this question as its not making much sense for what you need help with
Well, I'm creating a site where I need to have a binary tree for downline. Like if I refer someone to the site, he/she'll be my downline and will be putted under my tree (left/right). I've searched over the net but hardly find any solution. The hierarchy will looks like this image below:
i think binary tree concept makes no sense in php. it won't speed up array indexing. if you are worry about array performance then consider using PHP: SplFixedArray - Manual
and binary tree is just a headache for example if sub tree 3 somehow break child tree (6, 7) will easily not accessible (but can be fixed with small math)
for more info refer to Binary tree - Wikipedia, the free encyclopedia
PHP Binary Tree Recursion Algorithm - Stack Overflow
this one should help.
