Making a tree out of a 2 column list

Paul Rubin http
Sun Apr 15 18:54:21 EDT 2007


bearophileHUGS at lycos.com writes:
> > I guess this should make the program enter into a endless loop. But
> > the data won't have such a redundancy, because it was taken from a
> > philogenetic tree.
> 
> But errors and bugs do happen, inside data too; so often it's better
> to be on safe side if the safe code is fast enough.

If you think the data may be wrong it's probably better to use a 
traditional graph algorithm to check it for cycles, than rely on some
arbitrary recursion depth limit.



More information about the Python-list mailing list