tree data structure

Padraig Brady Padraig at Linux.ie
Fri Sep 6 07:59:33 EDT 2002


Hi,

I've a graph like stucture represented
by a list of tuples:

[(L0,S2), (S2,S0), (S2,S1), (S1,Q2), (S0,Q1), (S2,S3)]

And would like to convert it to
a tree structure like:

           S0 - Q1
         /
L0 - S2 - S3
         \
           S1 - Q2

Any tips appreciated.

Thanks,
Pádraig.




More information about the Python-list mailing list