Skip to content

Instantly share code, notes, and snippets.

@Two9A
Created September 17, 2010 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Two9A/584530 to your computer and use it in GitHub Desktop.
Save Two9A/584530 to your computer and use it in GitHub Desktop.
Node *reverse(Node *p)
{
Node *oldnext, *newnext;
while(p)
{
oldnext = p->next;
p->next = newnext;
newnext = p;
p = oldnext;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment