On Jan 4, 2008 10:36 PM, Michael Hutchinson <[EMAIL PROTECTED]> wrote:
> AFAIK you'd have to iterate it (though ForEach will simplify this). Of
> course, that's what a Contains () call would do anyway -- if you want
> O(1) contains calls, you'd need a hashtable, but a list obviously
> needs... a list.

Yes, that's the problem. It would be O(n) for a naïve approach.

Another option (besides hashtables, trees, etc) would be to store an
additional field on each entity stating that it was already included
or not, but of course this depends on how your code works, as it may
be not possible.

-- 
Felipe.
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to