206. Reverse Linked Listjava
題目大意:對一個鏈表進行反轉code
思路:ip
Java實現:leetcode
public ListNode reverseList(ListNode head) { ListNode newHead = null; while (head != null) { ListNode tmp = head.next; head.next = newHead; newHead = head; head = tmp; } return newHead; }