next up previous
Next: Up: Previous:

Operations

*
Extract-Min

Extract-Min(H)
$\;\;\;\;\;$z = min(H)
$\;\;\;\;\;$add z's children to root list $\;\;\;\;\;$ $\;\;\;\;\;$; O(D(n(H)))
$\;\;\;\;\;$remove z from root list
$\;\;\;\;\;$if root list $\neq$ {}
$\;\;\;\;\;$then Consolidate(H) $\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$; O(D(n(H)))
$\;\;\;\;\;$else min(H) = NIL
$\;\;\;\;\;$n(H) = n(H) - 1

*
Consolidate

Consolidate(H)
$\;\;\;\;\;$while two trees in H (T1,T2) have same degree
$\;\;\;\;\;$ $\;\;\;\;\;$change root list to following using Link(H, T2, T1):



\psfig{figure=figures/f13-7.ps}

$\;\;\;\;\;$for i = 0 to D(n(H))
$\;\;\;\;\;$ $\;\;\;\;\;$if tree T of degree i has root-key < min(H)
$\;\;\;\;\;$ $\;\;\;\;\;$then min(H) = T


next up previous
Next: Up: Previous: