private void heapify(int i){
        int l = left(i);
        int r = right(i);
        if(r<=this.heapsize){
            int min;
            if(this.heap[l].getKey()<this.heap[r].getKey()){
                min=l;
            }else{
                min=r;
            }
            if(this.heap[i].getKey()>this.heap[min].getKey()){
                Node temp = this.heap[i];
                this.location.put((T)(temp.getData()), min);
                this.location.put((T)(this.heap[min].getData()),i);
                this.heap[i]=this.heap[min];
                this.heap[min]=temp;
                heapify(min);
            }
        }else if(l==this.heapsize && this.heap[i].getKey()>this.heap[l].getKey()){
            Node temp = this.heap[i];
            this.location.put((T)(temp.getData()), l);
            this.location.put((T)(this.heap[l].getData()), i);
            this.heap[i]=this.heap[l];
            this.heap[l]=temp;
        }
    }