1. public class Simple206 {
    2. public ListNode reverseList(ListNode head) {
    3. ListNode pre =null;
    4. ListNode cur =head;
    5. while(cur.next !=null){
    6. ListNode next = cur.next;
    7. cur.next = pre;
    8. pre = cur;
    9. cur = next;
    10. }
    11. cur.next = pre;
    12. return cur;
    13. }
    14. }