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
Is stl open source?
write a program to convert a decimal number in to its equivalent binary number?
What is stl language?
What are stl algorithms?
What is the use of stl?
How stl is different from the c++ standard library?
How do I convert a stl file?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is the stl, standard template library?
What two types of containers does the stl provide?
how to use C++?
What is stl in oop?
What does stl mean in slang?
Describe the My Computer and My Documents folders; identify the elements that are present in every Window.
What is stl in c++ with example?