Rearrange the nodes of a linked list
Given a linked list, rearrange the node of the list as shown below: INPUT LIST: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 OUTPUT: 1 -> 8 -> 2 -> 7 -> 3 -> 6 -> 4 -> 5 INPUT LIST: 1 -> 2 -> 3 -> 4 […]
Reversing a doubly linked list
Given a doubly linked list. Write a function that accepts a pointer to the head of the list and reverse the list.