budget/src/main/java/budget/backend/structures/BinaryTreeHeap.java
private boolean upHeap(BinaryTreeNode<K,V> leaf){
		if (leaf.getParent() != null){
			if ((leaf.getKey()).compareTo((leaf.getParent()).getKey()) < 0){
				//switch the keys of the parent and the leaf
				sw(leaf.getParent(), leaf);
				//recursive call
				upHeap(leaf.getParent());

			} else if ((leaf.getKey()).compareTo((leaf.getParent()).getKey()) > 0)
				return true;
		}
		return false; //only possible if the key of the leaf equals to the key of the parent.
	}
/**
	 * Recursive implementation of upheaping; change the key of the parent and the child while the vlaue of the parent is >= than the key of the child.
	 * If the key already exists in the tree,
	 * @param leaf a {@link BinaryTreeNode} that has no children (on the first call)
	 * @return true if the upheap was successfull
	 * @return false otherwise; e.g. the key already existed in the tree
	 */
Recursive implementation of upheaping; change the key of the parent and the child while the vlaue of the parent is >= than the key of the child.
If the key already exists in the tree,
@param leaf a  BinaryTreeNode that has no children (on the first call)
@return true if the upheap was successfull
@return false otherwise; e.g. the key already existed in the tree
Recursive implementation of upheaping ; change the key of the parent and the child while the vlaue of the parent is > = than the key of the child . If the key already exists in the tree @param leaf a BinaryTreeNode that has no children ( on the first call ) @return true if the upheap was successfull @return false otherwise ; e . g . the key already existed in the tree
private boolean upHeap(BinaryTreeNode<K,V> leaf){
		if (leaf.getParent() != null){
			if ((leaf.getKey()).compareTo((leaf.getParent()).getKey()) < 0){
				sw(leaf.getParent(), leaf);
				upHeap(leaf.getParent());
			} else if ((leaf.getKey()).compareTo((leaf.getParent()).getKey()) > 0)
				return true;
		}
		return false; 
	}
private boolean upHeap ( BinaryTreeNode < K , V > leaf ) { if ( leaf . getParent ( ) != null ) { if ( ( leaf . getKey ( ) ) . compareTo ( ( leaf . getParent ( ) ) . getKey ( ) ) < 0 ) { sw ( leaf . getParent ( ) , leaf ) ; upHeap ( leaf . getParent ( ) ) ; } else if ( ( leaf . getKey ( ) ) . compareTo ( ( leaf . getParent ( ) ) . getKey ( ) ) > 0 ) return true ; } return false ; }
Recursive implementation of upheaping; change the key of the parent and the child while the vlaue of the parent is >= than the key of the child.
Recursive implementation of upheaping ; change the key of the parent and the child while the vlaue of the parent is > = than the key of the child .
//switch the keys of the parent and the leaf //recursive call //only possible if the key of the leaf equals to the key of the parent.