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 are the advantage of c language?
How can I write functions that take a variable number of arguments?
What is the maximum no. of arguments that can be given in a command line in C.?
What is a void * in c?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
What is the c language function prototype?
in linking some of os executables are linking name some of them
What is wrong with this statement? Myname = 'robin';
How can I find out if there are characters available for reading?
What does 4d mean in c?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
What is sizeof array?
What is the usage of the pointer in c?