Question: 1. Create a binary search method to search a target value, and return the index of the FIRST occurrence of the target element in a

1. Create a binary search method to search a target value, and return the index of the FIRST occurrence of the target element in a DESCENDING ordered array. Return -1 if you cannot find the target value in the array.

2. Create a binary search method to search a target value, and return the index of the LAST occurrence of the target element in a DESCENDING ordered array. Return -1 if you cannot find the target value in the array.

3. Use an array in descending order to test your method.

Using Eclipse IDE for Java

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!