list.cc
/* Reverse the list HEAD; modifies the links.  */
Reverse the list HEAD; modifies the links.
Reverse the list HEAD ; modifies the links .
static void
reverse (node **head)
{
  node *prev = nullptr, *cur = *head;
  while (cur)
    {
      node *next = cur->next;
      cur->next = prev;
      prev = cur;
      cur = next;
    }
  *head = prev;
}
static void reverse ( node * * head ) { node * prev = nullptr , * cur = * head ; while ( cur ) { node * next = cur -> next ; cur -> next = prev ; prev = cur ; cur = next ; } * head = prev ; }
Reverse the list HEAD; modifies the links.
Reverse the list HEAD ; modifies the links .