Question: b . Write a method that determines whether or not all of the values in a unsorted targets array are also in a sorted array.

b. Write a method that determines whether or not all of the values in a unsorted targets array are
also in a sorted array. Use the binarySearch() method in the Arrays class.
Example: If the sortedArray contained {2,3,8,9} and the targets array contained {3,2,3,2,3,2}, the
method should return true. If the targets array contained {8,6}, the method should return false.
public static boolean containsAll(int[] sortedArray, int[] targets)
 b. Write a method that determines whether or not all of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!