c#.net中有任何HashSet吗? [英] Is there any HashSet is there in c#.net ?
本文介绍了c#.net中有任何HashSet吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果有任何HASHSET手段,请举一些例子...
If any HASHSET means give some examples...
推荐答案
http://msdn.microsoft.com/en-us/library/bb359438.aspx [
http://msdn.microsoft.com/en-us/library/bb359438.aspx[^]
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
这篇关于c#.net中有任何HashSet吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文