微软自称非常高效的HashSet
微软自称非常高效,详情查看MSDN
using System;
using System.Collections.Generic;
class Test
{
static void Main()
{
HashSet<int> list = new HashSet<int>();
for (int i = 0; i < 5; i++)
{
list.Add(i);
}
foreach (int i in list)
{
Console.WriteLine(i);
}
}
}
using System.Collections.Generic;
class Test
{
static void Main()
{
HashSet<int> list = new HashSet<int>();
for (int i = 0; i < 5; i++)
{
list.Add(i);
}
foreach (int i in list)
{
Console.WriteLine(i);
}
}
}