Assume that a doubly linked list header stores the elements


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;
}

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Assume that a doubly linked list header stores the elements
Reference No:- TGS01246422

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)