5-4 鏈表的天然遞歸結構性質

整個鏈表=頭結點+後面整個鏈表     1 class Solution4 { 2 3 public ListNode removeElements(ListNode head, int val) { 4 5 if(head == null) //頭結點爲空,也就是整個鏈表爲空, 6 return head; //對於一個空鏈表
相關文章
相關標籤/搜索