Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .
Answer Posted / aniruddha
public int check(int a[], int b[])
{ int value,w;
for(int i=0; i<=a.length; i++)
{ w=0;
for(int j=0; j<b.length; j++)
{
if(a[i]!=b[j])
{ w++;
break;
}
}
if(w==0)
value=a[i];
}
return value;
}
| Is This Answer Correct ? | 12 Yes | 9 No |
Post New Answer View All Answers
Who created stl?
please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html
How does an stl file work?
What are the various types of stl containers?
How do I convert a stl file?
What is a list in c++ stl?
Why should a c++ programmer be interested in stl?
Name the different types of stl containers.
What is stl stand for?
What are stl algorithms?
When did c++ add stl?
Describe the My Computer and My Documents folders; identify the elements that are present in every Window.
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.
Explain stl.
what is template and type convertion