algo: reverse a single linked list