if array a conatins 'n' elements and array b conatins 'n-1'
elements.array b has all element which are present in array
a but one element is missing in array b. find that
element.
Answer Posted / ajay c.
Take a temp variable of datatype of the array element.
Place a[0] in temp.
now for each element in array a compare with all elements
of array b. if any element is not found in array b, that is
the missing element.
what i guess though is that the interviewer may be trying
to look for a short-cut method to achieve the above. So, i
googled it and found a very nice answer:
http://stackoverflow.com/questions/1235033/java-comparing-
two-string-arrays-and-removing-elements-that-exist-in-both-
arrays
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is define directive?
How many parameters should a function have?
Do variables need to be initialized?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is header file definition?
What is maximum size of array in c?
How are variables declared in c?
What is spaghetti programming?
Explain how can you tell whether a program was compiled using c versus c++?
What is a sequential access file?
How to draw the flowchart for structure programs?
What is a list in c?
Explain how can you avoid including a header more than once?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is cohesion and coupling in c?