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 types of structure?
What is null pointer constant?
What will be the outcome of the following conditional statement if the value of variable s is 10?
List some of the static data structures in C?
Describe the order of precedence with regards to operators in C.
What are preprocessor directives in c?
Explain what are the different data types in c?
Can i use “int” data type to store the value 32768? Why?
Explain the difference between call by value and call by reference in c language?
Explain what are multidimensional arrays?
Explain the Difference between the New and Malloc keyword.
Are local variables initialized to zero by default in c?
How can I dynamically allocate arrays?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
What is the value of h?