public static void merge(int A[], int m, int B[], int n) {
    	int i = 0, j = 0, index = 0;
    	for (i = m - 1, j = n - 1, index = m + n - 1; i >= 0 && j >= 0; index--) {
    		if (A[i] < B[j]) {
    			A[index] = B[j];
    			j--;
    		} else {
    			A[index] = A[i];
    			i--;
    		}
    	}
    	for (; j >= 0; j--) {
    		A[index] = B[j];
    		index--;
    	}
    }