首页 > 其他 > 详细

20172307 2017-2018-2 《程序设计与数据结构》第10周学习总结

时间:2018-05-20 22:38:07      阅读:233      评论:0      收藏:0      [点我收藏+]

20172307 2017-2018-2 《程序设计与数据结构》第10周学习总结

教材学习内容总结

  • 第十三章
  1. 教材学习中的问题和解决过程

  • 问题1:对流的概念不太清楚。
  • 问题1解决方案:通过查阅网上的资料对流有了大概的了解。流像是一个管道连接着输入和输出两端,一个留的方向是固定的,他通过占据一定的内存每次传输一定的数据信息。
    流是一个类,传输信息要调用这个类里的方法。
    参考至:(Java Stream简介, 流的基本概念)

代码调试中的问题和解决过程

  • PP12.1还算顺利吧,就一开始找思路的时候不太清楚要在哪用到递归
  • 解决方式:最后找到方法在左加右减的那里做递归。代码如下:

    static boolean pal(int left, int Right, String str) {
            boolean result = true;
    
            if (str.charAt(left) == str.charAt(Right) && left < Right) {
             left++;
                Right--;
                pal(left, Right, str);
            }else
                 result = false;
    
            return result;
  • PP12.9没有想到该怎样储存数据
  • 在参考赵晓海同学的想法后用二维数组来储存,自己一直没想到二维数组,以后要加深理解。

代码托管

技术分享图片

上周考试错题总结

  • The following method should return true if the int parameter is even and either positive or 0, and false otherwise. Which set of code should you use to replace ... so that the method works appropriately?
    public boolean question3(int x) { ... }:
    A . if (x = = 0) return true;else if (x < 0) return false;else return question3(x - 1);
    B . if (x = = 0) return false;else if (x < 0) return true;else return question3(x - 1);
    C . if (x = = 0) return true;else if (x < 0) return false;else return question3(x - 2);
    D . if (x = = 0) return false;else if (x < 0) return true;else return question3(x - 2);
    E . return(x = = 0);
    错误:A;正确:C
    解析:判断数是否为偶数,在递归时每次减二就可以实现。
  • Aside from writing recursive methods, another way that recursion is often used is to define:
    A . words in English
    B . mathematical functions
    C . rules and laws
    D . child classes of a parent class in object-oriented programming
    E . recursion is used in all of the above
    错误:E;正确:B
    解析:递归还可以用于实现数学公式。
  • An infinite loop and an infinite recursion:
    A . are different because it is impossible to detect the latter, while it‘s quite easy to detect the former
    B . both continue to repeat indefinitely
    C . both will be caught by the compiler
    D . both will be caught by the Java Virtual Machine during execution
    E . none of the above
    错误:A;正确:B
    解析:无限循环和无限递归都会没有限制的重复。

    结对及互评

  • 本周结对学习情况
    • 20172311
    • 对四则运算的进一步讨论!对IO异常的处理及文件的写入
  • 上周博客互评情况

其他

递归还是蛮难的,看例子的时候就十分困难,感觉还是需要继续学习递归。

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 5000行 30篇 400小时
第一周 200/200 2/2 20/20
第二周 300/500 1/3 18/38
第三周 500/1000 1/4 22/60
第四周 300/1300 1/5 30/90
第五周 700/ 2000 1/6 30/120
第六周 792/2792 1/7 30/150
第七周 823/3559 1/8 30/180
第八周 774/4333 3/9 30/ 210
第九周 426/4759 2/11 30/ 240

参考资料

20172307 2017-2018-2 《程序设计与数据结构》第10周学习总结

原文:https://www.cnblogs.com/20172307hyt/p/9064929.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!