@@ -0,0 +1,1255 @@
+/**%0A * Company%0A * Copyright (C) 2014-2017 All Rights Reserved.%0A */%0Apackage com.cwenao.trying.array;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A/**%0A * @author cwenao%0A * @version $Id FindPairOtherWay.java, v 0.1 2017-07-26 8:30 cwenao Exp $$%0A */%0Apublic class FindPairOtherWay %7B%0A%0A    private static final Logger LOG = LoggerFactory.getLogger(FindPairOtherWay.class);%0A%0A    private static void findPair(int%5B%5D array, int x) %7B%0A        int i;%0A        int len = array.length;%0A        for (i = 0; i %3C len - 1; i++) %7B%0A            if (array%5Bi%5D %3E array%5Bi + 1%5D) %7B%0A                break;%0A            %7D%0A        %7D%0A%0A        int low = (i + 1) %25 len;%0A        int high = i;%0A%0A        while (low != high) %7B%0A            if (array%5Blow%5D + array%5Bhigh%5D == x) %7B%0A                LOG.info(%22The x is %7B%7D, and the low element is %7B%7D , hig helement is %7B%7D%22,x,low,high);%0A                break;%0A            %7D%0A%0A            if (array%5Blow%5D + array%5Bhigh%5D %3C x) %7B%0A                low = (low + 1) %25 len;%0A            %7D else %7B%0A                high = (high + len - 1) %25 len;%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        // The array is must sorted and rotated%0A        int%5B%5D arrays = %7B0, 1, 3, 5, 10, 25, 4,6%7D;%0A        findPair(arrays, 9);%0A    %7D%0A%0A%7D%0A%0A

add find pair for sorted & rotated array