protected Junction split(Junction parent){
		int halfPointers;	//sets pointers to middle of this junction
		if (this.pointers.size()%2 == 0)
			 halfPointers= this.pointers.size() - this.pointers.size()/2;
		else
			 halfPointers= this.pointers.size() - this.pointers.size()/2 - 1;
		int halfElements= this.elements.size() - this.elements.size()/2;
		Vector<Link> newElements= new Vector<Link>();
		Vector<Object> newPointers= new Vector<Object>();
		while (halfElements < this.elements.size()){	//removes the links and adds them to the new juction
			newElements.add(this.elements.remove(halfElements));
		}
		while (halfPointers < this.pointers.size()){	//removes the sons and adds them to the new juction
			newPointers.add(this.pointers.remove(halfPointers));
		}
		this.numOfElements= 0;
		for (int i=0; i < this.pointers.size(); i++){	//sums all the elements under this junction and updates numOfElements
			if (this.pointers.elementAt(i) instanceof Leaf)
				this.numOfElements+= ((Leaf)this.pointers.elementAt(i)).getSize();
			else
				this.numOfElements+= ((Junction)this.pointers.elementAt(i)).numOfElements();
		}
		Junction newJunction= new Junction(newElements, this.T, parent, newPointers);
		for (int i=0; i < newPointers.size(); i++){	//sets the sons 'parent' to this
			Object temp= newPointers.elementAt(i);
			if (temp instanceof Leaf){	//sets the 'parent' value of all the sons of this junction
				Leaf tempLeaf= (Leaf)temp;
				tempLeaf.setParent(newJunction);
			}
			else {
				Junction tempJunction= (Junction)temp;
				tempJunction.setParent(newJunction);
			}
		}
		return newJunction;
	}//split(Junction)