4 ms·
void reverse_list(head) { struct node* current = head; struct node* last = NULL; struct node* next; while(current != NULL) { next = curre
by heatdeath 16y ago
void reverse_list(head) {
struct node* current = head;
struct node* last = NULL;
struct node* next;
while(current != NULL) {
next = current->next;
current->next = last;
last = current;
current = next;
}
}