Tree Algorithm
ian
londonperlmongers at iandocherty.com
Thu Dec 31 20:55:57 GMT 2009
James
Yes thats the ticket!
I especially like the description at the top of the first link.
'Nested sets rely on a demoralization of parts of the hierarchy'
There's probably something witty I could say about this concerning
politics but I don't want to start a flame war!
'modified preorder tree traversal' is a bit of a mouthfull and I am not
sure that 'nested sets' is the correct term either but at least the
descriptions make sense.
Thanks for those links.
Now to create a module!
Regards
Ian
James Coupe wrote:
> ian <londonperlmongers at iandocherty.com> wrote:
>> * Every node has a left and a right value and a level
>> * For any given node, all of it's descendents left values lie between
>> the nodes left and right values.
>> * For a leaf node, it's right value equals it's left value + 1
>> * All children of a parent will therefore be those with node numbers
>> between the parents left and right values and one level deeper.
>
> Nested Sets?
>
> http://www.codeproject.com/KB/database/nestedsets.aspx
>
> Some discussion here, although without giving a proper name to the
> structure.
>
> http://articles.sitepoint.com/article/hierarchical-data-database/2
>
More information about the london.pm
mailing list