public int[] maxHeapify(int[] tmpArray, int i){
		int left_i = 2*(i+1)-1;
		int right_i = 2*(i+1);
		int max_i = i;
		// if have not exceed the heap, and find the largest, 
		// the termination condition: largest index is i, and the condition of exceed has been consider in it.
//		System.out.println(i + ":" + left_i + ":" + right_i);
		if((left_i < tmpArray.length) && (tmpArray[left_i] > tmpArray[i])){
			max_i = left_i; 
		}
		if((right_i < tmpArray.length) && (tmpArray[right_i] > tmpArray[max_i])){
			max_i = right_i;
		}
		if(max_i != i){
			// exchange the position of largest and i
			int tmp = tmpArray[max_i];
			tmpArray[max_i] = tmpArray[i]; 
			tmpArray[i] = tmp;
			// for the sun tree of current node.
			this.maxHeapify(tmpArray, max_i);
		}
		return tmpArray;
	}