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; }
// Constructor copia. public CSet(CSet A) { for (int i = 0; i < mArray.Length; i++) { this.mArray[i] = A.mArray[i]; } this.mNum = A.mNum; }
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); }
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); }
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); }
private void btnInterjection_Click(object sender, EventArgs e) { // C = C.Interjection(A, B); C = A.Interjection(B); C.Print(lstSetC); }
private void btnUnion_Click(object sender, EventArgs e) { C = C.Union(A, B); // C = A.Union(B); C.Print(lstSetC); }
private void frmSetsOperations_Load(object sender, EventArgs e) { CSet D = new CSet(B); }