剑指offer:面试题24—反转链表

题目描述 输入一个链表,反转链表后,输出新链表的表头。java 解决:code public ListNode ReverseList(ListNode head) { if(head==null || head.next==null) return head; ListNode flag=head; ListNode pre=null;
相关文章
相关标签/搜索