标签:class tno ret log == node list nod lis
单链表的反转
public ListNode ReverseList(ListNode head) { if(head == null)return null; ListNode pre = null; ListNode next = null; while(head != null){ next = head.next; head.next = pre; pre = head; head = next; } return pre; }
标签:class tno ret log == node list nod lis
原文地址:http://www.cnblogs.com/liaoxiaolao/p/7591401.html