dynamic naming for hierarchical problem

gzeljko gzeljko at sezampro.yu
Fri Aug 10 21:25:22 EDT 2001


From: xauau <xauau at yahoo.com.au>
> 
> If I understand you correctly, a 'tree' is not only a good way of
> presenting this info to the user, it's also a straightforward way of
> representing it internally.
> 
Why
> You could build a fairly data structure called Tree which stores
> nodes. Each node could consist of a piece of data, a reference to its
> parent node, and a reference to a list of child nodes. (Like a doubly
> linked list, except that you'd have a list of children instead of a
> single 'next' pointer).
> 

Good comparison, but very often 'single linked list' here is
adequate as backup structure for visual-tree-control.
It can be simple stored:
in one rdbms (indexed) table { parent, child, child_atributes }
or Python (or bsddb) dictionary { parent: [child1, chid2 ..]}.

gzeljko








More information about the Python-list mailing list