Creating Tree Structure from associative array



Hi all,

I have an associative array, which contains parent and child relationships. I've searched the web for creating a tree structure from this and found a few good sites but doesnt help 100% perhaps someone can point me in the correct direction? I've started to code it got to a point where I cant go any further, the code is pseudo code and dont want to reinvent the wheel.

any suggestions would be really appreciated.

Thanks in advance

--
------------------------------------------------------------------------
Angelo Zanetti
Systems developer
------------------------------------------------------------------------

*Telephone:* +27 (021) 469 1052
*Mobile:* +27 (0) 72 441 3355
*Fax:* +27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* angelo@xxxxxxxxxxxx <mailto:angelo@xxxxxxxxxxxx>
.



Relevant Pages

  • Re: Representing Tree strcuture in database
    ... Self-joins are used to obtain children of a parent. ... edges" of left and right columns in its subtree. ... Think of it as collapsing the tree structure onto a line ... The Adjacency List model - while maybe easier to grasp - does not allow ...
    (microsoft.public.sqlserver.programming)
  • Re: Joe Celkos work with nested set models - update times??
    ... your upcoming book, but I can't wait until April to make the initial ... with a childless parent having ... > 3) Given a clustered index on the tree structure, ... > a tree structure in the adjacency list model (no cycles when the new ...
    (microsoft.public.sqlserver.programming)
  • Re: Searching in tree structures
    ... content is represented in a tree structure maintained in a database, ... tree and look at it's root node. ... The other solution is to, in addition to the parent node, also store ... the root node in the database. ...
    (comp.lang.php)
  • Re: Civil partnership
    ... The Master Genealogist appears to handle same-sex civil partnerships ... it also has provision for both biological and adoptive ... parent - child relationships. ...
    (soc.genealogy.britain)
  • Re: Database suggestion
    ... i.e. Can 11 have only one "parent" or multiple? ... If it can only have one parent, then I'd suggest using the structure ... tree structure is out of the window, so I'd suggest a simple string key, ... ...will INSERT new entries and UPDATE existing entries in one swoop. ...
    (comp.lang.php)