示例#1
0
        public static HashList <T> Union(HashList <T> ha1, HashList <T> ha2)
        {
            HashList <T> result = new HashList <T>();

            result.AddAll(ha1);
            result.AddAll(ha2);
            return(result);
        }
示例#2
0
        public static HashList <T> Difference(HashList <T> ha1, HashList <T> ha2)
        {
            HashList <T> result = new HashList <T>();

            foreach (T x in ha1.Where(x => !ha2.Contains(x)))
            {
                result.Add(x);
            }
            return(result);
        }
示例#3
0
        public static HashList <T> Intersection(HashList <T> ha1, HashList <T> ha2)
        {
            HashList <T> result = new HashList <T>();

            foreach (var x in ha1.Where(ha2.Contains))
            {
                result.Add(x);
            }
            return(result);
        }
示例#4
0
 public bool UnsequencedEquals(HashList <T> that)
 {
     return(Count == that.Count && seq.All(x => that.set.Contains(x)));
 }