public static int searchDescending(long[] longArray, long value) { 
        int start = 0;
        int end = longArray.length - 1;
        int middle = 0;
        
        while(start <= end) {
            middle = (start + end) >> 1;
        
            if(value == longArray[middle]) {
                return middle;
            }
            
            if(value > longArray[middle]) {
                end = middle - 1 ;
            }
            else {
                start = middle + 1;
            }
        }
                

        return -1;
    }
public static int searchDescending ( long [ ] longArray , long value ) { int start = 0 ; int end = longArray . length - 1 ; int middle = 0 ; while ( start <= end ) { middle = ( start + end ) > > 1 ; if ( value == longArray [ middle ] ) { return middle ; } if ( value > longArray [ middle ] ) { end = middle - 1 ; } else { start = middle + 1 ; } } return - 1 ; }
Search for the value in the reverse sorted long array and return the index.

@param longArray array that we are searching in.
@param value value that is being searched in the array.

@return the index where the value is found in the array, else -1.