Skip to content

Instantly share code, notes, and snippets.

@FanaHOVA
Last active February 3, 2016 11:06
Show Gist options
  • Save FanaHOVA/1689bc1095b319fd21c2 to your computer and use it in GitHub Desktop.
Save FanaHOVA/1689bc1095b319fd21c2 to your computer and use it in GitHub Desktop.
Node* Reverse(Node *head)
{
Node *current_node = head, *next_node;
head = NULL;
while (current_node != NULL) {
next_node = current_node->next;
current_node->next = head;
head = current_node;
current_node = next_node;
}
return head;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment