Solution for 3.2: Reversing a singly-linked list.