[olug] [OT] Of parents and children

Rob Townley rob.townley at gmail.com
Thu Feb 24 17:39:41 UTC 2005


"If a node moves to it's subnode it retains its children" - you must
mean the subnode retain's its children, not the original node.

The two scenarios you mention produce exactly the same tree, so i am
assume you typoed.


On Thu, 24 Feb 2005 10:48:31 -0600, Kevin Lanik <kevin.lanik at gmail.com> wrote:
> Slightly off topic, but an interesting programming problem here. I'm
> programming in objective-c (language doesn't matter much though) and I
> basically have a tree. My problem is that I'd like to be able to take
> a node and move it into one of it's children (or, since there is X
> level of depth) or somewhere in it's own lineage. It's been decided to
> preserve as much hierarchy as possible, so if a node moves to it's
> subnode it retains its children. For example, node 1's parent is the
> root node: it has children 2 and 3. 2 has children 4 and 5. I want to
> move node 1 into node 4's list. The first of two scenarios now is that
> node 2's parent becomes the root node and node 1's parent  becomes
> node 4, all other nodes stay the same. The other scenario makes node
> 4's parent the root node and node 1's parent 4, with all other nodes
> retaining thier parents. Does this make sense? The current solution is
> that we don't allow a node to be dropped in one of its children (or
> down the line) but would choosing one of these two be more appropriate
> than the other? I know this isn't exactly the forum for the question,
> but who doesn't enjoy a puzzler!
>  -Kevin
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
>



More information about the OLUG mailing list