public double findMedianSortedArrays_2(int A[], int B[]) {
        int m = A.length;
        int n = B.length;
        int a = 0;
        int b = 0;
        int des = (m+n) >> 1;
        int c1 = 0, c2 = 0;
        int i = 0, j = 0;
        for(int k = 0; k <= des; ++k){
            a = (m == 0 || i == m)? Integer.MAX_VALUE: A[i];
            b = (n == 0 || j == n)? Integer.MAX_VALUE: B[j];

            c1 = c2;
            c2 = Math.min(a,b);

            if(a < b) ++i;
            else ++j;
        }

        if (((m+n) & 0x1) == 1) {
            return c2;
        } else {
            return (c1+c2) / 2.0;
        }
    }