| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Nested sort, trying again
Well, you have code to move subtrees around in TREES & HIERARCHIES, so
you can sort the tree structure after a change. A node (lft,rgt) pair
(x,y) has a level that is easy to compute so you can see all the
children of a common parent; this gives an ugly view with all the nodes
at that same level in the hieratchy. The brother to the right is (r,
y+1) and the brother to the right is (x-1, s) , or they do not exist.
But being lazy, I would convert the nested sets to an adjacency list, then use the stack algorithm to rebuild the tree in sorted order. Slower, but easier to code. Received on Sat Oct 08 2005 - 18:24:20 CDT
![]() |
![]() |