예제 #1
0
 public void Copy(CSet Origin, CSet Destiny)
 {
     for (int i = 0; i < Origin.mNum; i++)
     {
         Destiny.mArray[i] = Origin.mArray[i];
     }
     Destiny.mNum = Origin.mNum;
 }
예제 #2
0
 // Constructor copia.
 public CSet(CSet A)
 {
     for (int i = 0; i < mArray.Length; i++)
     {
         this.mArray[i] = A.mArray[i];
     }
     this.mNum = A.mNum;
 }
예제 #3
0
 public void Copy(CSet Origin, CSet Destiny, ListBox lstData)
 {
     for (int i = 0; i < Origin.mNum; i++)
     {
         Destiny.mArray[i] = Origin.mArray[i];
     }
     Destiny.mNum = Origin.mNum;
     Print(lstData);
 }
예제 #4
0
        public CSet Union(CSet B)
        {
            CSet Temp = new CSet(this);

            for (int i = 0; i < B.mNum; i++)
            {
                Temp.Insert(B.mArray[i]);
            }
            return(Temp);
        }
예제 #5
0
        public CSet Interjection(CSet B)
        {
            CSet Temp = new CSet();

            for (int i = 0; i < mNum; i++)
            {
                for (int j = 0; j < B.mNum; j++)
                {
                    if (mArray[i] == B.mArray[j])
                    {
                        Temp.Insert(mArray[i]);
                        break;
                    }
                }
            }
            return(Temp);
        }
예제 #6
0
 private void btnInterjection_Click(object sender, EventArgs e)
 {
     // C = C.Interjection(A, B);
     C = A.Interjection(B);
     C.Print(lstSetC);
 }
예제 #7
0
 private void btnUnion_Click(object sender, EventArgs e)
 {
     C = C.Union(A, B);
     // C = A.Union(B);
     C.Print(lstSetC);
 }
예제 #8
0
 private void frmSetsOperations_Load(object sender, EventArgs e)
 {
     CSet D = new CSet(B);
 }