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
Hai, My name is nisha.I have NIC exam.If anybody Knows NIC previous paper pattern pls send me to nishanairp@gmail.com
WS-NUM PIC S9(05)V(02) SIGN TRAILING SEPARATE MOVE '0050000+' TO WS-NUM The value stored is 00500,00+ MOVE '0050000-' TO WS-NUM Then what is the value will be stored in WS-NUM? Am getting '-00500,00'.....>>> What should I declare to WS-NUM so that I can get correct values for both + & - signs.
In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?
Give examples of macro quoting function?
why we use abstract in awt?
What are the tasks performed by a Team Lead
I am work in it aompenei
WHAT IS MAIN IMPORTANT THING IN SOFTWARE?
Differevce between arrays and array builders?
what is the extension of SPDS Dynamic cluster tables?
1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?
along with oracle which language will be beneficial to have knowledge with,java,.net,since i m doing oracle have appeared for 8th sem BEIT,plz suggest
Find out the list of roles which gives access to GUI activities? thanks in advance
how to convert infix expression to prefix expression?
What is the purpose of