Can someone take a look and let me know if this is right...
I need to add a method/function to output a linked list in reverse order. I need to use either the header and source files for the dynamic list class. I cannot reset links or alter the original linked list. I need some help by 8 so any assistance is greatly appreciated
void linklist::reverse()
{
node *curr = p, *prev = NULL, *nxt_fwd = NULL;
//p is header
while(curr)
{
nxt_fwd = curr->link;
curr->link = prev;
prev =curr;
curr=nxt_fwd;
}
p = prev; /*save the new head */
}