Original Post
Data structures are not my strong suit. I am looking for a collection that will do this general pattern better than List : foo is some arbitrary reference type. Normally I'd go for some list wrapper over a balanced tree, but .NET sorted stuff seems to require pairs and seems not to want to just use the references (or some internal token) as the balance condition. Something in the standard lib I'm missing? Some well known non-standard lib I'm missing? Advise, questions?
if( Collection.Contains( foo ) ){
return;
}
Collection.Add( foo );
// process foo.
// recurse.