Question: Example 6 / * * Returns false if there is any element common to two arrays. * / public static boolean example 6 ( int
Example
Returns false if there is any element common to two arrays.
public static boolean exampleint data
int n data.length;
for int j; j n; j
for int kj; k n; k
if dataj datak
return false; found duplicate pair
return true; if we reach this, elements are unique
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
