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
What for decision coverage and modified condition decision coverage are used? Wat is the difference between them?
Explain the difference between an expert and a novice user. How would your strategy for designing user interfaces for an expert user differ from that for designing user interfaces for a novice user.
How can we develop a multi-tier application in Java?
What is the first message line that any language learning prints on the screen? and why?
Define distributed queries. can you explain me as soon as possible
What is SOLID Principle in Programming Language?
How will you prove that java swing is multithreaded?
Can anyone send me NIC question papers alongwith answers on nidhi1485@yahoo.co.in? Urgently needed.. Thanks in advance
Explain the types of operations? Draw the figure for shift and rotate operations?
Is buffer size and file block size is similar? If similar,at which case it will be same size?
WHat is execution in manual testing and when will we start execution and what language we use in execution
what is difference between input parameter and output parameter.
A good website has the following conditions It should be interactive. It should contain at least 20 images. Title cannot be null and should contain at least 10 letters other than spaces and hyphen (-). The keywords should contain atleast three among the following list : "design", "Graphics", "lovely", "beautiful", "amazing" and "mesmerising" Write a method: boolean isGoodWebsite(boolean isInteractive, int numOfImages, String title,String keywords[]) isInteractive whether the site is interactive or not numOfImages Number of images on the website title Title of the website keywords Array of keywords in the website.
how to check single or double byte in struts
could u please also write an example of a code that involves instances from an abstract class just as u did for interfaces because u said it could also work which i really doubt. thanks