budget/src/main/java/budget/backend/structures/BinaryTreeHeap.java
protected void add(K key) throws NullPointerException{
		try{
			//the the tree is empty, initialise a new tree			
			if (isEmpty()){
				root = new BinaryTreeNode<K,V>(key);
				//reset the root of the superclass
				super.root = root;
				last = root;
			}
			//add new node to the last element, find new last and sort the tree again
			else{
				findNext();				
				last.setKey(key);			
				upHeap(last);		
			}
			size++;
		} catch(NullPointerException e){
			throw e;
		}
			
	}
/** Definition of the abstract method in the superclass. Only to be used by insert */
Definition of the abstract method in the superclass. Only to be used by insert
Definition of the abstract method in the superclass . Only to be used by insert
protected void add(K key) throws NullPointerException{
		try{
			if (isEmpty()){
				root = new BinaryTreeNode<K,V>(key);
				super.root = root;
				last = root;
			}
			else{
				findNext();				
				last.setKey(key);			
				upHeap(last);		
			}
			size++;
		} catch(NullPointerException e){
			throw e;
		}
	}
protected void add ( K key ) throws NullPointerException { try { if ( isEmpty ( ) ) { root = new BinaryTreeNode < K , V > ( key ) ; super . root = root ; last = root ; } else { findNext ( ) ; last . setKey ( key ) ; upHeap ( last ) ; } size ++ ; } catch ( NullPointerException e ) { throw e ; } }
Definition of the abstract method in the superclass.
Definition of the abstract method in the superclass .
//the the tree is empty, initialise a new tree			 //reset the root of the superclass //add new node to the last element, find new last and sort the tree again