Wednesday, June 18, 2008


Fibonacci-Heap-Insert (H, x)

The above procedure inserts a node x in a given fibonacci heap H. The node x is added to the left of the min [H] pointer.
Step 1 Initialization
set deg [x]  0
set Parent [x]  Nil
set child [x]  Nil
set left [x]  right [x]  x
set mark [x]  FALSE.
Step 2 Concatenation of root list containing x with root list H.
if (min [H] = Nil or key [k] < key [min [H]) then
set min [H]  x
Step 3 Addition of new node
set n [H]  n [H] + 1

No comments: