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
Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.
Is stl part of c++ standard?
How stl is different from the c++ standard library?
What does stl stand for in basketball?
What is the stl, standard template library?
How connect plc and pc through software
write a program to convert a decimal number in to its equivalent binary number?
Can we use stl in coding interviews?
What does stl mean in slang?
Is there any error below, its a code to delete all entires from a map #include
what is template and type convertion
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
What are the various types of stl containers?
What do stl stand for?
What is a list in c++ stl?