next up previous
Next: Up: Previous:

Operations

*
Union

Union(H1, H2)
$\;\;\;\;\;$H = new heap whose root list contains roots from H1 and H2
$\;\;\;\;\;$n(H) = n(H1) + n(H2)
$\;\;\;\;\;$min(H) = min(H1)
$\;\;\;\;\;$if (min(H1) = NIL) or (min(H2) $\neq$ NIL and min(H2) <min(H1))
$\;\;\;\;\;$then min(H) = min(H2)



Analysis:

t(H) = t(H1) + t(H2)
m(H) = m(H1) + m(H2)


\begin{eqnarray*}\hat{c_i} & = & c_i + \Phi(H) - (\Phi(H_1) + \Phi(H_2)) \\
& ...
... 2m(H_1) + t(H_2) + 2m(H_2)] \\
& = & O(1) + 0 \\
& = & O(1)
\end{eqnarray*}



next up previous
Next: Up: Previous: