Reverse a linked list.
Definition of a single linked list:
Implement function reverse to reverse a linked list.