you are never re-establishing the new list order...
you must set the pointers in reverse order...
while popping them re-assign their pointers to the next popped item
someptr = stack.top
stack.pop
someotherptr = stack.top
someptr->next = someotherptr
Last edited on
Not sure where do I put that... After a while loop? Thank you!