write a program for finding the union of two integer array
in java?
Answer Posted / 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 |
Post New Answer View All Answers
difference between mantis and other tools?
in IBM PC -AT.WAT AT REFERS TO?
How can we develop a multi-tier application in Java?
Given an array of size n+1 which contains all the numbers from 1 to n.Find the number which is repeated in O(n) time.How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?
Give examples of macro quoting function?
hoe to data grid use in sql server 2000?
it is a language or tools?
iam confused among testing ,.net and java. can anybody help me.
What's the difference b/w Table & Templete in Smartform?
You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?
How will you prove that java swing is multithreaded?
could you please tell me how to draw the calibration curve for HPLC {the software which we are using}?
How does the type system works when there is interoperability between a COM and .Net, i mean what exactly happens there
Is there any standard procedure to test the application as a whole? Or How can I test complete application right from the requirement gathering?
What is the use of Differ interface check box in Ship confirm?