exercises/ex13/list_errors_soln.c
void reverse(Node **list) {
    Node *node = *list;
    Node *next, *temp;

    if (node == NULL || node->next == NULL) {
        return;
    }

    next = node->next;
    node->next = NULL;

    while (next != NULL) {
        temp = next->next;
        next->next = node;
        node = next;
        next = temp;
    }
    *list = node;
}
/* Reverses the elements of the list.
*
* Does not allocate or free nodes.
*
* list: pointer to pointer to Node
*/
Reverses the elements of the list.
Does not allocate or free nodes.

pointer to pointer to Node
Reverses the elements of the list . Does not allocate or free nodes . pointer to pointer to Node
void reverse(Node **list) {
    Node *node = *list;
    Node *next, *temp;
    if (node == NULL || node->next == NULL) {
        return;
    }
    next = node->next;
    node->next = NULL;
    while (next != NULL) {
        temp = next->next;
        next->next = node;
        node = next;
        next = temp;
    }
    *list = node;
}
void reverse ( Node * * list ) { Node * node = * list ; Node * next , * temp ; if ( node == NULL || node -> next == NULL ) { return ; } next = node -> next ; node -> next = NULL ; while ( next != NULL ) { temp = next -> next ; next -> next = node ; node = next ; next = temp ; } * list = node ; }
Reverses the elements of the list.
Reverses the elements of the list .