Question on tree-walking and mutually-recursive types

Zack Weinberg zack@codesourcery.com
Tue Jun 29 03:35:00 GMT 2004


kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:

>     Yes walk using a hashtable saying you already walked the tree.
>     walk_tree_without_duplicates is what you want.
>
> Well, I figured out a way to perhaps keep the cost under control but still
> handle the pathalogical case.   I used what was below and it works,
> but YUCK!

A hash table is way overkill.  How about the usual two-pointers
collapsing loop algorithm to detect the cycle?

zw



More information about the Gcc mailing list