private static void mergeArray(int A[], int bt, int mid, int ed) {
		int i, j, k, len = ed - bt + 1;
		int tmp[] = new int[len];

		for (i = bt, j = mid + 1, k = 0; i <= mid && j <= ed; k++) {
			if (A[i] <= A[j]) {
				tmp[k] = A[i++];
			} else {
				tmp[k] = A[j++];
			}
		}

		while (i <= mid) {
			tmp[k++] = A[i++];
		}

		while (j <= ed) {
			tmp[k++] = A[j++];
		}

		for (i = 0; i < k; i++) {
			A[bt + i] = tmp[i];
		}
	}