title: Use a Binary Search on an int array sorted in descending order
body: <pre><code>import java.util.*;
  import java.io.*;
  import java.util.Arrays;
  import java.util.Collections;
  import org.apache.commons.lang3.ArrayUtils;
  @SuppressWarnings("unused")
  public class Tester {
      public static void main(String args[]){
          int i[] = {-7, 15, 21, 22, 43, 49, 51, 67, 81, 84, 89, 95, 97};
          ArrayUtils.reverse(i);
          System.out.println(binarySearch(i, 22));
          System.out.println(binarySearch(i, 89));
          System.out.println(binarySearch(i, -100));
          System.out.println(binarySearch(i, 72));
          System.out.println(binarySearch(i, 102));
      }
      private static int binarySearch(int a[], int srchVal){
          int lb = 0;
          int ub = a.length - 1;
  
          while(lb &lt;= ub){
              int mid = (lb + ub)/2;
              if(a[mid] == srchVal){
                  return mid;
              }
              else if(srchVal &gt; a[mid]){
                  lb = mid + 1;
              }
              else{
                  ub = mid - 1;
              }
           }
          return -1;
      }
  }
  </code></pre>
  
  <p>For an assignment in class I need to modify the BinarySearch method so that it will work properly with the reversed array. But I can't figure out how I'm supposed to modify it.</p>