lc206 反转链表
class Solution {
public ListNode reverseList(ListNode head) {
ListNode prev = null;
ListNode curr = head;
while (curr != null) {
ListNode next = curr.next;
curr.next = prev;
prev = curr;
curr = next;
}
return prev;
}
}
标签:head,null,ListNode,lc,0921,next,curr,prev
From: https://www.cnblogs.com/beichuang/p/16716926.html