Skip to content

Instantly share code, notes, and snippets.

@blaineh
Created October 29, 2011 18:59
Show Gist options
  • Save blaineh/1324930 to your computer and use it in GitHub Desktop.
Save blaineh/1324930 to your computer and use it in GitHub Desktop.
Is this a good method?
Void Reverse (Node head)
{
Node prev= null;
Node current = head;
Node nextNode = null;
while (current!=null)
{
nextNode = current.Next;
current.Next = prev;
prev=current;
current = nextNode;
}
head = prev;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment