| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Adjacency list to Nested set model statement
I've cleaned up the code and posted it at:
http://willets.org/treecrawl.sql
It's now clean Oracle PL/SQL, and it works. I simplified it slightly to do only the DFS node numbering, but the rest is not hard.
One only needs a stack if a node can have multiple paths to it from root. In that case the stack is needed as a breadcrumb trail to ensure that backtracking goes back the way it came. In a single-parent tree there's no ambiguity.
I have another idea for a more parallelizable algorithm based on some stuff I did a few years ago. I'll see if I can reconstitute the stuff I need to try that out. Received on Fri Mar 01 2002 - 02:07:20 CST
![]() |
![]() |