Math  /  Discrete

Question21) Consider method ff Inds omethang below: ``` // Precondition: a.length 1s equal to b.length public static boolean findsomething(int[] a, int[] b) I for(Int aValue ; a) l boolean Cound = Ialse; for(lnt bValue: b) l 1f(bValue == aValue) found = truel l 1f (l found) return False। l rELUFN tEUG। l ```
Method findBomething retums true only if... (A) arrays a and b contaf identeal eloments in the amome order (B) arays a and b contan identigal slementa in Fevers order (C) arrays a and b confan none of the Bamo elements (D) array a contains at least one eloment that is also in b (1) Every slement of array a la also in b, and every eloment of array b is also in a

Studdy Solution
The correct option is: (E) Every element of array `a` is also in `b`, and every element of array `b` is also in `a`.
The method `findsomething` returns `true` only if:
(E) Every element of array a is also in b, and every element of array b is also in a. \boxed{\text{(E) Every element of array } a \text{ is also in } b, \text{ and every element of array } b \text{ is also in } a.}

View Full Solution - Free
Was this helpful?

Studdy solves anything!

banner

Start learning now

Download Studdy AI Tutor now. Learn with ease and get all help you need to be successful at school.

ParentsInfluencer programContactPolicyTerms
TwitterInstagramFacebookTikTokDiscord