Tree Traversal April 28, 2006
Posted by mika76 in Algorithm, Article, Coding.add a comment
I have been checking out some information for tree traversal algorithms (hence my previous post) and came upon the following articles. These are all abut the Modified PreOrder Tree Traversal (MPTT) algorithm.
- Storing Hierarchical Data in a Database from SitePoint
- Tree Traversal from Wikipedia
- Trees in Oracle SQL by Philip Greenspun
- Trees in SQL by Joe Celko
- Graphs, Trees, and Hierarchies by Joe Celko
- Cameron Perry’s web development blog #1, #2 and #3
After reading all these (and more) I am starting to understand it and to see how the implementation differs from the Adjacency List algorithm (the one where you have a parent_id on each child and use recursion to read). The biggest difference that there is is the fact that you don't need to use any sort of recursion to read in the data, but the inserting and updating of rows is far more involved using MPTT.


