private double findMedianSortedArrays(int[] A, int[] B)
    {
      if(A==null || A.length==0)
      {
          if(B==null || B.length == 0)
          {
              return 0.0;
          }
          else
          {
              if(B.length % 2 ==0)
              {
                  return (B[B.length>>1]+ B[(B.length>>1)-1])/2.0;
              }
              else
              {
                  return B[B.length>>1];
              }
          }
      }
      else if(B == null || B.length == 0)
      {
          if(A.length % 2 ==0)
          {
              return (A[A.length>>1]+ A[(A.length>>1)-1])/2.0;
          }
          else
          {
              return A[A.length>>1];
          }
      }

      if ( A.length <= B.length )
      {
          return getMedianNum(A, 0, A.length, B, 0, B.length);
      }
      else
      {
          return getMedianNum(B, 0, B.length, A, 0, A.length);
      }

    }