private static void maxheapIfy(int A[], int i, int n) {
		int left, right, loc;

		while (i < n) {
			left = 2 * i + 1;
			right = 2 * i + 2;
			loc = i;

			if (left < n && A[left] > A[i]) {
				i = left;
			}

			if (right < n && A[right] > A[i]) {
				i = right;
			}

			if (loc != i) {
				A[i] = A[loc] ^ A[i];
				A[loc] = A[loc] ^ A[i];
				A[i] = A[loc] ^ A[i];
			} else {
				break;
			}
		}
	}