Binomial-Heap-Insert (H, x)
The above Procedure inserts a node ‘x’ in a given binomial heap, ‘H’. It uses a ‘Binomial-Heap-Union’ operation for uniting the heap H, and heap H1 which contains the node ‘x’.
Step 1 Creating an empty Binomial heap.
set H1 Create-Binomial-Heap (x)
Step 2 Initialization
set Parent [x] Nil
set Lchild [x] Nil
set sib [x] Nil
set deg [x] 0
set head [H1] x.
Step 3 Uniting H and H1 binomial heaps.
H Binomial-Heap-Union (H, H1)
No comments:
Post a Comment