20162311 2017-2018-1 《程序设计与数据结构》第五周学习总结

20162311 2017-2018-1 《程序设计与数据结构》第五周学习总结

教材学习内容总结

  • 本周学习教材第十四章,主要内容是掌握数据结构中的栈
  • 栈具有先进后出的特点(FILO)
  • 如何使用栈计算后缀表达式(上学期实现过)
  • 使用数组实现栈,根据教材上的要求,实现ArrayStack中剩余的方法
  • 使用链表实现栈,同时实现LinkedStack中剩余的方法
  • 学习了包的组织。代码不是随便打包,应当按功能分包

教材学习中的问题和解决过程

  • 问题1:看了教材14.1.1对抽象数据类型的介绍,不是很懂,它和数据类型有什么区别?
  • 问题1解决方案:在网上查找相关资料。其实抽象数据类型只是一个数学模型以及定义在模型上的一组操作。通常是对数据的抽象,定义了数据的取值范围以及对数据操作的集合。但是并没有实现这些操作,即并不能直接调用这些方法进行操作。具体解释参见数据类型和抽象数据类型

代码托管


(statistics.sh脚本的运行结果截图)

上周考试错题总结

  • 错题1
A(n) _____________________ is a list collection has elements whose elements can be referenced using a numeric index.
A .ordered list
B .unordered list
C .indexed list
D .linked list
E .array
正确答案: C  

解析:An indexed list has a numeric index that can be used to refer to an element.  Ordered and unordered lists do not have an index.  Linked lists and arrays are implementation strategies that can be used for collections.(索引列表具有一个可用于引用元素的数值索引。有序和无序列表没有索引。链接列表和数组是可以用于集合的实现策略。)
  • 错题2
What is the nature of the methods that are added to the OrderedListADT and UnorderedListADT interfaces that extend the ListADT interface?
A .They are  methods to add elements to the list
B .They are methods to remove elements from the list
C .They are methods to delete the list
D .They add a method to determine the location of an element in the list
E .They add a method to determine the size of the list
正确答案: A  

解析:The add method is defined in the OrderedListADT interface.  The addToFront, addToRear, and addAfter methods are defined in the UnorderedLIstADT interface.(在orderedlistadt接口中定义了add方法。addtofront、addtorear和addafter方法在unorderedlistadt接口中定义。)
  • 错题3
The Serializable interface allows
A .Exceptions to be thrown from methods.
B .objects to be read from and written to external files.
C .Object class elements to be added to list collections.
D .compiler warning messages to be suppressed.
E .none of the above
正确答案: B  

解析:The Serializable interface supports the writing and reading of objects to and from a file.  Exceptions do not require an interface in order to be thrown.  Objects of the Object class can be added to a list collection using a cast operator.  Compiler warning messages should be addressed, not suppressed.(可序列化接口支持对文件和从文件中的对象的编写和读取。异常不需要一个接口才能被抛出。对象类的对象可以使用cast操作符添加到列表集合中。编译器警告消息应该被处理,而不是被抑制。)
  • 错题4
Which of the following is not a way to categorize list collections?
A .public
B .ordered
C .unordered
D .indexed
E .all of the above are ways to categorize list collections
正确答案: A  

解析:Choices b), c), and d) are all ways to categorize list collections.(选择b )、c )和d)是对列表集合进行分类的方法。)
  • 错题5

A user does not have any control over the order of the elements in an unordered list
A .true
B .false
正确答案: B  

解析:A user can add elements to either end of an unordered list or insert them between other elements.  The user controls the order of the list.  The list is unordered because there is no inherent relation between the elements in the list.(用户可以向无序列表的任一端添加元素,或在其他元素之间插入元素。用户控制列表的顺序。列表是无序的,因为列表中的元素之间没有固有的关系。)
  • 错题6

Using a circular array for an array-based implementation of a list would improve the performance of the operation to remove an element from the middle of a list
A .true
B .false
正确答案: B  

解析:Removing an element from somewhere other than the rear of the list requires that other elements be shifted to close the gap.  A circular array does not eliminate the need to shift elements and does not offer a performance improvement over an array that is not circular.(从列表尾部以外的某个位置删除一个元素,需要将其他元素转移到缩小间隙。一个循环数组不消除移位元素的需要,也不提供对非循环的数组的性能改进。)

结对及互评

本周结对学习情况

  • 20162325

  • 结对学习内容

    • 课上测试的排序和查找测试
    • 用链表和数组实现栈

思考

栈应该是我们接触的第一种数据结构,上学期就用过,所以熟悉一些。现在要我们自己来实现栈,相当于学习地更深入了。之前就做过用数组实现列表之类的作业,所以现在做起这个感觉也是一个道理,只要你理解了栈的这些方法的本质,知道栈是怎么进行操作的,那么一切就简单了,你只需要通过代码去实现就行了。当然这其中肯定会遇到一些问题,不过书上也给出了提示,也实现了几个方法,其余的老师课上也讲过了,我们只需要课下照着完成就行。当然,我觉得我们学习主要还是要学会如何运用这些数据结构,而只有深刻理解了,才能更好的运用

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 5000行 30篇 400小时
第一周 0/0 1/1 10/10
第二周 0/0 0/1 15/25
第三周 721/721 3/4 15/40
第四周 0/721 1/5 15/55
第五周 1234/ 1955 1/6 16/71
  • 计划学习时间:21小时

  • 实际学习时间:16小时

  • 改进情况:本来是计划平均每天至少3小时,但由于一些原因,没能真正做到,接下来要想这个目标前进

参考资料

posted @ 2017-10-14 10:56  20162311张之睿  阅读(262)  评论(0编辑  收藏  举报