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
Get step-by-step solutions from verified subject matter experts
