private void modifyMinHeap(int[] heap, int n, int i) {
    	int stand = i;
    	
    	while (stand < n) {
    		int initial = stand;
    		int left = stand * 2 + 1;
    		int right = stand * 2 + 2;
    		
    		if (left < n && heap[left] < heap[stand]) {
    			stand = left;
    		}
    		
    		if (right < n && heap[right] < heap[stand]) {
    			stand = right;
    		}
    		
    		if (stand == initial) {
    			break;
    		} else {
    		    changeValue(heap, initial, stand);
    		}
    	}
    }