public static void maxHeapify(int[] a, int i, int heapSize) {
		int left = left(i);
		int right = right(i);
		int largest = i;
		if (left <= heapSize && a[left] > a[i]) {
			largest = left;
		}
		if (right <= heapSize && a[right] > a[largest]) {
			largest = right;
		}

		if (largest != i) {
			swap(a, i, largest);
			maxHeapify(a, largest, heapSize);
		}
	}