水下功夫做透,水上才能顺风顺水。

翻转链表

public ListNode reverseList(ListNode head) { if(head==null || head.next ==null){ return head; } ListNode cur = head.next; head.next = null; while(cur!
posted @ 2022-03-06 13:47  北方寒士  阅读(22)  评论(0编辑  收藏  举报