budget/src/main/java/budget/backend/structures/AVLSearchTree.java
public AVLTreeNode<K,V> insertAndReturn(K key){
		AVLTreeNode<K,V> n;
		if (isEmpty()) {
			root = new AVLTreeNode<>(key);
			root.setLeft(empty);
			root.setRight(empty);
			n = root;
		} else {
			n = findPlace(key, root);
			if (n.isEmpty())
				return empty; //unsuccessfull insertion
			n.setLeft(empty);
			n.setRight(empty);
			updateHeight(n);
			reorderTree(n);
		}
		size++;
		return n;
	}
/**
	 * When setting up a multi-map, it is good to be able to have a pointer to the last inserted node,
	 * and refer to it in other data structures. 
	 * Should be used with caution though, because this returns adirect reference to a part of the tree, and some of its methods can violate the properties of the Tree. 
	 * Proper encapsulation could solve this problem 
	 * @param key 
	 * @return the new AVLTreeNode
	 * @return the empty node if the insertion was unsuccessfull
	 */
When setting up a multi-map, it is good to be able to have a pointer to the last inserted node,
and refer to it in other data structures.
Should be used with caution though, because this returns adirect reference to a part of the tree, and some of its methods can violate the properties of the Tree.
Proper encapsulation could solve this problem
@param key
@return the new AVLTreeNode
@return the empty node if the insertion was unsuccessfull
When setting up a multi - map it is good to be able to have a pointer to the last inserted node and refer to it in other data structures . Should be used with caution though because this returns adirect reference to a part of the tree and some of its methods can violate the properties of the Tree . Proper encapsulation could solve this problem @param key @return the new AVLTreeNode @return the empty node if the insertion was unsuccessfull
public AVLTreeNode<K,V> insertAndReturn(K key){
		AVLTreeNode<K,V> n;
		if (isEmpty()) {
			root = new AVLTreeNode<>(key);
			root.setLeft(empty);
			root.setRight(empty);
			n = root;
		} else {
			n = findPlace(key, root);
			if (n.isEmpty())
				return empty; 
			n.setLeft(empty);
			n.setRight(empty);
			updateHeight(n);
			reorderTree(n);
		}
		size++;
		return n;
	}
public AVLTreeNode < K , V > insertAndReturn ( K key ) { AVLTreeNode < K , V > n ; if ( isEmpty ( ) ) { root = new AVLTreeNode < > ( key ) ; root . setLeft ( empty ) ; root . setRight ( empty ) ; n = root ; } else { n = findPlace ( key , root ) ; if ( n . isEmpty ( ) ) return empty ; n . setLeft ( empty ) ; n . setRight ( empty ) ; updateHeight ( n ) ; reorderTree ( n ) ; } size ++ ; return n ; }
When setting up a multi-map, it is good to be able to have a pointer to the last inserted node,
 and refer to it in other data structures.
When setting up a multi - map it is good to be able to have a pointer to the last inserted node and refer to it in other data structures .
//unsuccessfull insertion