This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on tree-walking and mutually-recursive types
Well yes in the case if every node only has one edge (eg. only structs with
one pointer).
In the case where a node can have multiple edges, Tortoise and Hare isn't
practicable.
For a directed graph Topological sort is a very good algorithm.
You only have to make some small changes and don't need the sorting part.
But you would maybe need O(number of nodes) memory which would be a fallback
to Tortoise and Hare.
cu, Locke