Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is define directive?

1149


How many parameters should a function have?

1193


Do variables need to be initialized?

1051


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1197


What is header file definition?

1084


What is maximum size of array in c?

1041


How are variables declared in c?

1102


What is spaghetti programming?

1131


Explain how can you tell whether a program was compiled using c versus c++?

1102


What is a sequential access file?

1173


How to draw the flowchart for structure programs?

9338


What is a list in c?

1030


Explain how can you avoid including a header more than once?

1093


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2879


What is cohesion and coupling in c?

1031