public static double findMedianSortedArrays(int A[], int B[]) {
		int m = A.length;
		int n = B.length;
		int i = 0, j = 0, k = 0;
		int[] C = new int[m + n];
//		System.out.println(m);
//		System.out.println(n);
		while (i < m && j < n) {
			if (A[i] < B[j])
				C[k++] = A[i++];
			else
				C[k++] = B[j++];
		}
		while (i < m)
			C[k++] = A[i++];
		while (j < n)
			C[k++] = B[j++];
		if (((m + n) & 1) == 1)
			return C[(m + n - 1) / 2];
		else {
//			System.out.println(C[(m + n) / 2]);
//			System.out.println(C[(m + n-1) / 2]);
			//pay attention to the return value
			return ((double)(C[(m + n) / 2] + C[(m + n -1) / 2])) / 2;
		}

	}