Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Nested sort, trying again

Re: Nested sort, trying again

From: -CELKO- <jcelko212_at_earthlink.net>
Date: 8 Oct 2005 16:24:20 -0700
Message-ID: <1128813860.926512.275700@g14g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US