//以Person類爲例 Person current = first; for(int i = 0; i < n(指定整數);i++){ current = current.next;//遍歷列表 }
//以上課時講的Student類爲例 public static void InsertNode(Student head,Student node1,Student node3){ Student point = head; while((point.number != node1.number) && point != null){ point = point.next; } if (point.number == node1.number){ //此處的兩句絕對不可以換位置,否則可能會形成NullPointerException node3.next = point.next; point.next = node3; } }
//仍然以Student類爲例 public static void DeleteNode(Student head,Student node){ Student pre = head, current = head; while (current != null){ if (current.number != node.number){ pre = current; current = current.next; } } pre.next = current.next;//關鍵步驟 }
緣由及理解狀況:當時看到這道題的時候其實我不是很肯定,可是看到在書的第7頁有這樣一段話:html
軟件系統必須通過精心設計、編碼和文檔說明,以便爲開發人員、維護人員和用戶提供支持。java
當時看完以後就以爲好像除了這三種人也沒有其餘的了,可是查了查發現還有系統管理員之類的角色存在。node
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 30篇 | 400小時 | |
第一週 | 10/10 | 1/1 | 10/10 | |
第二週 | 608/618 | 2/3 | 20/30 |