Пример #1
0
 public static MyDictionary <TKey, TValue> Intersect <TKey, TValue>(this MyDictionary <TKey, TValue> first, MyDictionary <TKey, TValue> second)
 {
     throw new NotImplementedException();
 }
Пример #2
0
        public static MyDictionary <TKey, TValue> Union <TKey, TValue>(this MyDictionary <TKey, TValue> first, MyDictionary <TKey, TValue> second)
        {
            MyDictionary <TKey, TValue> result = new MyDictionary <TKey, TValue>();

            foreach (var keyValuePair in first)
            {
                result.Add(keyValuePair.Key, keyValuePair.Value);
            }
            foreach (var keyValuePair in second)
            {
                result.Add(keyValuePair.Key, keyValuePair.Value);
            }
            return(result);
        }