public void heapify(ArrayList<Integer> array, int index,int size) {
		
			
		int left = this.getLeft(index);
		int right = this.getRight(index);

		int largest = array.get(index);
		int temp = index;

		if (left != -1 && array.get(left) > largest && left<size) {
			largest = array.get(left);
			temp = left;
		}

		if (right != -1 && array.get(right) > largest && right <size) {
			largest = array.get(right);
			temp = right;
		}
		
		if (temp != index) {
			int tempo = array.get(index);
			array.add(index, array.get(temp));
			array.remove(index+1);
			array.add(temp, tempo);
			array.remove(temp+1);
		
			if(temp < size / 2){
				heapify(array,temp,size);
			}
		}
		
	}