"Someone" <no****@nospam.com> wrote in message
news:dp**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi,
What sort of data structures does c# have to create a set. Java allows
you
to create a set, just wondering what I can use in c#. Will I be forced to
implemented custom code?
Do what Java does, which is to base a Set on a Map (or as .NET 1.1 calls it,
Hashtable)
public class HashSet
{
Hashtable tbl = new Hashtable;
public void Add(Object o)
{
tbl[o] = tbl;
}
public bool Contains(Object o)
{
return tbl[o] != null;
}
}
etc.