next up previous
Next: Up: Previous:

Operations

*
Decrease-Key

Decrease-Key(H, x, k)
$\;\;\;\;\;$key(x) = k
$\;\;\;\;\;$p = parent(x)
$\;\;\;\;\;$if p $\neq$ NIL and key(x) < key(p)
$\;\;\;\;\;$then Cut(H, x, p)
$\;\;\;\;\;$ $\;\;\;\;\;$Cascading-Cut(H, p)
$\;\;\;\;\;$if key(x) < key(min(H))
$\;\;\;\;\;$then min(H) = x



Cut(H, x, p)
$\;\;\;\;\;$remove x from children of p
$\;\;\;\;\;$add x to root list of H
$\;\;\;\;\;$mark(x) = False



Cascading-Cut(H, p)
$\;\;\;\;\;$next-p = parent(p)
$\;\;\;\;\;$if next-p $\neq$ NIL
$\;\;\;\;\;$then if mark(p) = False
$\;\;\;\;\;$ $\;\;\;\;\;$then mark(p) = True
$\;\;\;\;\;$ $\;\;\;\;\;$else Cut(H, p, next-p)
$\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$Cascading-Cut(H, next-p)


next up previous
Next: Up: Previous: