Assume that a doubly linked list "header" stores the elements of a priority queue. Implement the function pop(), which deletes the element with the largest value from the list (priority queue).
template < typename T >
void pop(dnode< T > *header);
Here is my best Guess at the problem!
{
if ( header->next = = header)
return;
dnode< T > *prevNode = header->prev, *succNode = header->next;
prevNode->next = succNode;
succNode->prev = prevNode;
delete header;
}