Sébastien Lorion <[EMAIL PROTECTED]> wrote:

> Considering that operations on the tree are centralized in the Tree class,

By making this assertion, IMO you've pre-selected a particular notion of
interacting with a tree.

Usually, when I work with a tree, my node *is* my tree (i.e. it's the
root of the tree). What's more, I often don't store parent pointers and
instead rely on e.g. visiting algorithms to store the parent stack
during a recursive traversal, if such parents are required for certain
operations. And taking a leaf (ahem) from the pages of functional
programming, when parent pointers are eliminated, subtrees may be shared
between multiple trees, since my nodes are often read-only after
construction (and thus aliasing issues aren't important).

There's more down this branch too: persistent datastructures often rely
on the logarithmic performance of operations on trees to permit keeping
e.g. undo-state around quite cheap.

Can you say more about your particular tree?

-- Barry

-- 
http://barrkel.blogspot.com/

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to