Is there a collection among .NET collection that doesn't allow duplicates?
ArrayList is very suitable for what I need, except it allows duplicate values.
I've searched the System.Collections namespace but couldn't find anything alike.
if you find it useful - rate it!
/******\
|__|-o | |
\******/
Thank you Norfy, very nice implementation.
I was going to implement a set anyway,
just wanted to check if there's already an implementation among .NET's collections.
if you find it useful - rate it!
/******\
|__|-o | |
\******/
I learnt this from you,didn't get why you used a hashtable while you set every key to null..wel we could also use an IList..
Quite simply, the behaviour of the keys collection of a Hashtable is that of a set.
For small sets then an IList is ok but for larger sets a Hashtable is quicker.
Useful? Then click on (Rate This Post) at the top of this post.
there are some interesting collections that NHibernate uses...
the DLL is Iesi.Collections.
I don't know the licensing policy, but i think they're ok generally.
if you find it useful - rate it!
/******\
|__|-o | |
\******/
For small sets then an IList is ok but for larger sets a Hashtable is quicker.
we want to just look for in an collection and keys in hashtable are just an ICollection ...hastable is fast but when we give a key and want its item,well its time is O(1)
but when we want to get whether an item is included or not..
no difference between a hashtable(keys) and IList...(both of them are an ICollection)
both of them have O(n).
Whether you ask a Hashtable for a value or if it contains a key the access time is not linear O(n) , it uses hashing for both.
I meant when we ask a hashtable whetere it contains a key the time is not O(1)..I meant it doesn't use hashing...
and you tell it use hashing(how?) ..I don't know exactly..
no problem...should have a look at one of my book
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.