<p>So far I have encountered adjacency list, nested sets and nested intervals as models for storing tree structures in a database. I know these well enough and have migrated trees from one to another.</p>

<p>What are other popular models? What are their characteristics? What are good resources (books, web, etc) on this topic?</p>

<p>I'm not only looking for db storage but would like to expand my knowledge on trees in general. For example, I understand that nested sets/intervals are especially favorable for relational database storage and have asked myself, are they actually a <i>bad</i> choice in other contexts?</p>

[{'answer_id': 27863, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 2, 'selected': False, 'text': "<p>A variation is where you use a direct hierarchical representation (ie. parent link in node), but also store a path value.</p>\n\n<p>ie. for a directory tree consisting of the following:</p>\n\n<pre><code>C:\\\n   Temp\n   Windows\n       System32\n</code></pre>\n\n<p>You would have the following nodes</p>\n\n<pre><code>Key     Name     Parent     Path\n1       C:                  *1*\n2       Temp       1        *1*2*\n3       Windows    1        *1*3*\n4       System32   3        *1*3*4*\n</code></pre>\n\n<p>Path is indexed, and will allow you to quickly do a query that picks up a node and all its children, without having to manipulate ranges.</p>\n\n<p>ie. to find C:\\Temp and all its children:</p>\n\n<pre><code>WHERE Path LIKE '*1*2*%'\n</code></pre>\n\n<p>This representation is the only place I can think of where storing <em>id's</em> in a string like this is ok.</p>\n"}, {'answer_id': 28217, 'author': 'Stu', 'author_id': 414, 'author_profile': 'https://Stackoverflow.com/users/414', 'pm_score': 2, 'selected': True, 'text': '<p>The seminal resource for this are chapters 28-30 of <a href="https://rads.stackoverflow.com/amzn/click/com/1558605762" rel="nofollow noreferrer" rel="nofollow noreferrer">SQL for Smarties</a>.</p>\n\n<p>(I\'ve recommended this book so much I figure Celko owes me royalties by now!)</p>\n'}]
['https://Stackoverflow.com/questions/27850', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2077/']