void reverse() { node* current, * prev, * temp; current = head; prev = NULL; while (current != NULL) { temp = current->next; current->next = prev; prev = current; current = temp; } head = prev; }