Reverse a singly linked list.
用三个指针 tail,p,q,紧紧相邻,不断前进,每次将p.next指向tail,将q.next指向p。
tail
p
q
p.next
q.next