Making a tree out of a 2 column list
Mon Apr 16 00:54:21 CEST 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