Marek
Dąbek
Software Engineer,
Intel Technology
Poland
Temat: Zagadka/i ;)
Może tak:Marek Dąbek edytował(a) ten post dnia 09.02.11 o godzinie 22:45
struct _list;
struct _list {
int data;
struct _list *head;
struct _list *next;
};
struct _list *revert(struct _list* head)
{
struct _list* prev = NULL, *next_tmp = NULL;
struct _list* curr = NULL;
for (curr = head; curr != NULL; ){
next_tmp = curr->next;
curr->next = prev;
prev = curr;
curr = next_tmp;
}
return prev;
}