write a program for finding the union of two integer array
in java?
Answers were Sorted based on User's Feedback
Answer / satish kumar
void union(int x[],int y[])
{
int n=x.length + y.length ;
int z[]=new int[n];
int p=x.length;
for(int i=0;i<x.length;i++)
{
z[i]=x[i];
}
int j=0;
for(int i=0;i<y.length;i++)
{
for(j=0;j<x.length;j++)
{
if(y[i]!=z[j])
{
continue;
}
else
{
if(y[i]==z[j])
break;
}
}
if(j==x.length)
z[p++]=y[i];
}
Is This Answer Correct ? | 32 Yes | 24 No |
Answer / nadeem khokhar
the above mentioned code is also good one. but i m giving you an algorithm you can say, so you can get the concept and convert it into any language
int a[3]=1,2,3;
int b[3]=2,3,4;
for(int i=0; i <=2; i++)
{
for(int j=0; j<=2; j++)
{
if(a[i] == b[j])
cout<<a[i]; is a union of a and b
}
}
Is This Answer Correct ? | 14 Yes | 26 No |
8.In DSP,Define Signal and System?and various type of signals.
I am taking the bmc control m/enterprise manager 7.0 scheduling test and just wanted to see what kind of questions they would ask or if anyone has taken the test and how long it is for how many questions?
HOW TO BREAK THE FIREWALL?
what is programmable BIST in today ic design
what is the last ant version you worked?how to get it
what is runtime exception and compiletime exception ?
Is class is a abstract datatype in java?
what is dynamic polymorphism?
what is the abap/4
Piggy backing is a technique for a) Flow control b) sequence c) Acknowledgement d) retransmition
17 Answers Fast Booking, HCL, Lucent, NIC,
Write a shell program to test whether a given year is leap year or not ?
how much fee for deccan soft institute .how to block seat for sandeep sir class reply soonnnn