日期:2014-05-17 浏览次数:20906 次
class ComparerClass : System.Collections.Generic.IEqualityComparer<int[]>
{
public bool Equals(int[] a, int[] b)
{
if (a == null && b == null)
return true;
else if (a != null && b != null)
{
if (a.Length != b.Length)
return false;
a = a.OrderBy(t => t).ToArray();
b = b.OrderBy(t => t).ToArray();
for (int i = 0; i < a.Length; i++)
if (a[i] != b[i])
return false;
return true;
}
else return false;
}
public int GetHashCode(int[] ary)
{
return base.GetHashCode();
}
}
// rec = rec.Distinct(new ComparerClass()).ToList();