You are viewing a single comment's thread. Return to all comments →
DoublyLinkedListNode* reverse(DoublyLinkedListNode* head) { DoublyLinkedListNode* t=head; DoublyLinkedListNode* p=head; int te; while(t->next!=NULL){ t=t->next;}
while(t->prev!=NULL && t->next!=p && t!=p){ te=p->data; p->data=t->data; t->data=te; t=t->prev; p=p->next; } while(p->prev!=NULL){ p=p->prev;} return(p);
}
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a doubly linked list
You are viewing a single comment's thread. Return to all comments →
DoublyLinkedListNode* reverse(DoublyLinkedListNode* head) { DoublyLinkedListNode* t=head; DoublyLinkedListNode* p=head; int te; while(t->next!=NULL){ t=t->next;}
}