Skip to content

Instantly share code, notes, and snippets.

@ben-ng ben-ng/rev.c
Created Mar 4, 2019

Embed
What would you like to do?
Reverse a linked list in C
while (current != null) {
next = current->next;
current->next = prev;
prev = current;
current = next;
}
head = prev;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.