private void decreaseKeyWithComparator(Node<K, V> n, K newKey) {
        int c = comparator.compare(newKey, n.key);
        if (c > 0) {
            throw new IllegalArgumentException("Keys can only be decreased!");
        }
        n.key = newKey;
        if (c == 0) {
            return;
        }

        if (n.next == null) {
            throw new IllegalArgumentException("Invalid handle!");
        }

        // if not root and heap order violation
        Node<K, V> y = n.parent;
        if (y != null && comparator.compare(n.key, y.key) < 0) {
            cut(n, y);
            cascadingCut(y);
        }

        // update minimum root
        if (comparator.compare(n.key, minRoot.key) < 0) {
            minRoot = n;
        }
    }
private void decreaseKeyWithComparator ( Node < K , V > n , K newKey ) { int c = comparator . compare ( newKey , n . key ) ; if ( c > 0 ) { throw new IllegalArgumentException ( "Keys can only be decreased!" ) ; } n . key = newKey ; if ( c == 0 ) { return ; } if ( n . next == null ) { throw new IllegalArgumentException ( "Invalid handle!" ) ; } Node < K , V > y = n . parent ; if ( y != null && comparator . compare ( n . key , y . key ) < 0 ) { cut ( n , y ) ; cascadingCut ( y ) ; } if ( comparator . compare ( n . key , minRoot . key ) < 0 ) { minRoot = n ; } }
/*
Decrease the key of a node.