PQ Implementationswith Linked Lists
Method 1: Always insert at the head of the list: O(1)
For DeleteMin, perform a linear search for the pair holding the smallest priority value: O(n).
Method 2: Maintain the list in sorted order of increasing priority. Always insert an element at its correct position in the list: O(n).
For DeleteMin, simply remove the first element: O(1)
(2, Sue), (5, Joe), (9, Amy), (9, Sam)