Click here to Skip to main content
15,909,939 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
If any HASHSET means give some examples...
Posted
Comments
Toli Cuturicu 11-Dec-10 7:53am    
You can find it in .net 4.0 (vs 2010), not in .net 2.0 (vs 2005)

1 solution

http://msdn.microsoft.com/en-us/library/bb359438.aspx[^]

C#
HashSet<int> evenNumbers = new HashSet<int>();
HashSet<int> oddNumbers = new HashSet<int>();
for (int i = 0; i < 5; i++)
{
    // Populate numbers with just even numbers.
    evenNumbers.Add(i * 2);
    // Populate oddNumbers with just odd numbers.
    oddNumbers.Add((i * 2) + 1);
}


Thanks,
Mamun
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900