next up previous
Next: Up: Previous:

Operations

*
Insert

Insert(H, x)
$\;\;\;\;\;$set x's fields appropriately
$\;\;\;\;\;$add x to root list of H $\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$; O(1)
$\;\;\;\;\;$reset min(H) if needed
$\;\;\;\;\;$n(H) = n(H) + 1



Analysis:

H = initial heap with t(H) trees and m(H) marked nodes
H' = new heap, t(H') = t(H) + 1, m(H') = m(H)

\(\hat{c_i} \;=\; c_i \;+\; \Phi(H') \;-\; \Phi(H)\)

= O(1) + [t(H) + 1 + 2m(H)] - [t(H) + 2m(H)]

= O(1) + 1 = O(1)


next up previous
Next: Up: Previous: