Hello friend,
How to change the following matching algorithm is LINQ?
static void NotExist(int[] a, int[] b) {
bool YES;Console.WriteLine("The 'b' array element does not exist:");for (int i = 0; i < a.Length; i++){
for (int j = 0; j < b.Length; j++){YES = false;
if (a[i] == b[j]){
YES = true;break;
}}
if (!YES) Console.Write("{0},",a[i]);}
}Console.Write("\b ");
static void Main(string[] args){
int[] a = new int[5] { 1, 22, 39, 6, 10 };int[] b = new int[5] { 2, 4, 39, 10, 89 };NotExist(a, b);Console.ReadKey();
}
Thanks.

Jignesh TrivediPosted Feb 25, 2014, 11:42 PM
try...
var k1 = a.Except(b);
foreach (var h in k1)
{
Console.WriteLine(h);
}
hope this will help you.
Joginder BangerPosted Feb 26, 2014, 1:27 AM
for any query hit to reply