Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void reverse(List *list) {
- ListItem *newHead = list->tail, *t;
- for (ListItem *item = list->head; item; item = item->prev) {
- t = item->prev;
- item->prev = item->next;
- item->next = t;
- }
- list->tail = list->head;
- list->head = newHead;
- }
Add Comment
Please, Sign In to add comment