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 this infamous null pointer, anyway?
show how link list can be used to repersent the following polynomial i) 5x+2
Is there any demerits of using pointer?
Array is an lvalue or not?
Are the variables argc and argv are local to main?
What are the 5 elements of structure?
Explain about the constants which help in debugging?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
What is string in c language?
Differentiate between new and malloc(), delete and free() ?
What the different types of arrays in c?
What are bitwise shift operators in c programming?
How macro execution is faster than function ?
What is the symbol indicated the c-preprocessor?
What are external variables in c?