private void findChildren(ArrayList<Pair> priorityQueue,
			int elementPosition, boolean greaterThan) {
		int childIndex = elementPosition;

		int childLeftIndex = 2 * childIndex + 1;
		int childRightIndex = 2 * childIndex + 2;
		Pair grandChildLeft = null;
		Pair grandChildRight = null;

		if (childLeftIndex < priorityQueue.size())
			grandChildLeft = priorityQueue.get(childLeftIndex);
		if (childRightIndex < priorityQueue.size())
			grandChildRight = priorityQueue.get(childRightIndex);

		if (greaterThan) {
			if (grandChildLeft != null) {
				if (grandChildRight != null
						&& grandChildRight.p > grandChildLeft.p)
					swapHeapDownUp(priorityQueue, grandChildRight,
							childRightIndex);
				else
					swapHeapDownUp(priorityQueue, grandChildLeft,
							childLeftIndex);
			}
		} else {
			if (grandChildLeft != null) {
				if (grandChildRight != null
						&& grandChildRight.p < grandChildLeft.p)
					swapHeapDownUp(priorityQueue, grandChildRight,
							childRightIndex);
				else
					swapHeapDownUp(priorityQueue, grandChildLeft,
							childLeftIndex);
			}
		}
	}