public class Solution {
    public ListNode ReverseList(ListNode head) {
        ListNode pre = null ;
        ListNode cur = head ;
        while(cur != null) {
            ListNode nxt = cur.next ;
            cur.next = pre ;
            pre = cur ;
            cur = nxt ;
        }
        return pre ;
    }
}