Tree Algorithm

James Coupe james at zephyr.org.uk
Thu Dec 31 17:56:42 GMT 2009


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

-- 
James Coupe


More information about the london.pm mailing list