コード例 #1
0
        public MySet Merge(MySet other)
        {
            if (other == null)
            {
                return(this);
            }
            other = other.Find();
            var me = this.Find();

            if (other == me)
            {
                return(other);
            }

            if (other.Size > me.Size)
            {
                me.Root     = other;
                other.Size += me.Size;
                me.Size     = other.Size;
                return(other);
            }
            else
            {
                other.Root = me;
                me.Size   += other.Size;
                other.Size = me.Size;
                return(me);
            }
        }
コード例 #2
0
 public TEntity Find(object key)
 {
     return(MySet.Find(key));
 }