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
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number
what is the BAM? where we can use it in BizTalk server?
Given a set. Write the pseudo code to get all the subsets for the given set. Eg. Input : {1,2} Output : (),(1),(2),(1,2)
I need source code for Enrollment System using Visual Basic 6.0/2008 database MS Access 2007 for my school thesis project...please help me..kindly send in my email jpinedamcp@gmail.com
what are the 3 forms of a prolog term
5. How do you round the addition or subtraction of two numbers in assembler?
which worker is involved in all the phases of SDLC?
Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
any drawback are there in mantis?
Which method protects back button to retrieve old value from previous page in Struts.
difference between mantis and other tools?
What is %Type,%Rowtype?
Why did you ever become involved in QA/testing?
what is integration testing in real time applications?
how do i add a column dynamically in a table by using java application?