Insertion: consider inserting entry to the priority queue implement with a heap . The insertion algorithm (insert(k,x)) is as follows:
- Add a node to with operation
addso that this new node becomes the last node of and stores entry . - Restore the heap-order property that may be violated by the previous action.