-
-
Save evanpurkhiser/3688271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void LinkedList<T>::reverseList() | |
{ | |
ListNode<T> *previous; | |
previous = NULL; | |
ListNode<T> *temp; | |
while(head != NULL) | |
{ | |
temp = head->next; | |
head->next = previous; | |
previous = head; | |
head = temp; | |
} | |
head = previous; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment