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
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999
What are stl algorithms?
Name the different types of stl containers.
What is a standard template library (stl)? What are the various types of stl containers?
What does stl mean in slang?
Is string part of stl?
What are the components of stl?
Is stl part of c++ standard?
What is stl stack?
In what scenario does the Logical file and Physical file being used?
how to making game in c++ ?
What is stl in oop?
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
Is there any error below, its a code to delete all entires from a map #include
Why should a c++ programmer be interested in stl?