using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Linq;
namespace Discrete_Structures
{
public partial class Form1 : Form
{
int[] array2;
int[] array1;
int[] value;
int num1;
int num2;
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
int[] arrayA = new int[10];
for (num1 = 0; num1 < 10; num1++)
{
Console.ReadLine();
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
int[] arrayB = new int[10];
for (num2 = 0; num2 < 10; num2++)
{
Console.ReadLine();
}
}
private void intersection_Click(object sender, EventArgs e)
{
// Call Intersect extension method.
var intersect = arrayB.Intersect(arrayA);
// Write intersection to screen.
foreach (int value in intersect)
{
Console.WriteLine(intersect);
}
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
//Write Union to screen
foreach (int num in union)
{
Console.Write("{0} ", num);
}
//Write Difference to screen
foreach (int value in complement)
{
Console.WriteLine(complement);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void union_Click(object sender, EventArgs e)
{
IEnumerable<int> union = arrayA.Union(arrayB);//Compares all values found in array1 and 2 and places all on screen.
}
private void difference_Click(object sender, EventArgs e)
{
var complement = arrayA.Except(arrayB, new MyTypeEqualityComparer());
}
}
}
Ismail Issa 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
JOSheaIV 119 C# Addict
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.