//以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 |