I have been cracking my head at achieving something very simple in C in order to make my one of the programs (not written by me) in our computational physics project more dy
Today i came across same kind of problem statement,i googled for solution for an hour and end up with no solution,the above all approaches are not correct solutions for the stated problem
The Better way to resolve above Problem is
Sort the two arrays either in ascending or descending order, Then compare both the arrays.
#include
void sort_it(int a[], int size)
{
int i,j,temp=0;
for(i=0;ia[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
};
int compare(int size,int a[],int b[])
{
int i,j,is_equal;
for(i=0;i