劍指offer:面試題24—反轉鏈表

題目描述 輸入一個鏈表,反轉鏈表後,輸出新鏈表的表頭。java 解決:code public ListNode ReverseList(ListNode head) { if(head==null || head.next==null) return head; ListNode flag=head; ListNode pre=null;
相關文章
相關標籤/搜索