You are viewing a single comment's thread. Return to all comments →
C++
auto cur = llist; // best to remember SinglyLinkedListNode* prev = NULL; while(cur){ auto next = cur->next; cur->next = prev; prev = cur; cur = next; } return prev;
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
C++