楼主: xxcindy
跳转到指定楼层
上一主题 下一主题
收起左侧

[入门|算法|数据结构] CS 61B 在职学习Data Structure 打卡

🔗
 楼主| xxcindy 2021-3-22 11:46:03 | 只看该作者
全局:
Week 2 Mon (day 1):
看完了lecture,总结下:
- Java has 9 data types, 8 of them are primitive types and the last one is reference type
- int a = 1
declare type int, name it a -> create 32 bit -> set the value of that location to 1

- Dog a = new Dog()
declare type reference type, intended to store only Dog objects, initially with value null -> find enough space to store the object, use constructor to construct the instance, returns the memory location -> assign the memory location to a

- int[] a = new int[]{1,2,3}
declare type reference type, intended to store only int arrays, initially with value null -> find enough space to store the array (length of 3), use constructor to create the instance, returns the memory location -> assign the memory location to a

- Copy values:
When we copy values, we copy whatever the value is in the bits. If it's a primitive type, these bits represent values. If it's a reference type, these bits represent address of the referenced object.

- Passing params:
In java, all params are passed by copying the arguments to variables local to the function. (Pass by value). Again, this value might represent an actual value (int, string), or an address of an object

- 最后提到了IntList,就是LinkedList, 不过只适用于int



回复

使用道具 举报

🔗
 楼主| xxcindy 2021-3-23 11:37:10 | 只看该作者
全局:
今天把 “Scope, Pass-by-Value, Static” 的discussion做了,有这几个observations:
- 一般来说要避免class variable 和instance variable 重名
- this.xxx 优先指向instance variables/methods,如果没有定义,则指向class variables/methods
ref: https://docs.oracle.com/javase/t ... vaOO/classvars.html
- Instance methods can access instance variables and instance methods directly.
- Instance methods can access class variables and class methods directly.
- Class methods can access class variables and class methods directly.
- Class methods cannot access instance variables or instance methods directly—they must use an object reference. Also, class methods cannot use the this keyword as there is no instance for this to refer to.
回复

使用道具 举报

全局:
请问楼主这是公开课吗? 有无证书?谢谢
回复

使用道具 举报

🔗
 楼主| xxcindy 2021-3-25 03:19:43 | 只看该作者
全局:
flywei0228LRZG 发表于 2021-3-25 02:53
请问楼主这是公开课吗? 有无证书?谢谢

不是公开课 无证书。
回复

使用道具 举报

🔗
 楼主| xxcindy 2021-3-27 23:43:41 | 只看该作者
全局:
本帖最后由 xxcindy 于 2021-3-27 23:45 编辑

费时2h做完了project 0。一周做完正常学校一周的教学🤦。看来快速解决这门课是不太可能了。希望之后暑假不工作了能刷的快一些。
回复

使用道具 举报

🔗
 楼主| xxcindy 2021-3-28 11:58:16 | 只看该作者
全局:
补充下project0的submission

image.png (1.04 MB, 下载次数: 0)

image.png
回复

使用道具 举报

🔗
 楼主| xxcindy 2021-3-30 12:40:34 | 只看该作者
全局:
费时5.5h做完了project 1a。

Screen Shot 2021-03-29 at 11.39.45 PM.png (1.1 MB, 下载次数: 1)

Screen Shot 2021-03-29 at 11.39.45 PM.png
回复

使用道具 举报

🔗
 楼主| xxcindy 2021-4-6 12:58:42 | 只看该作者
全局:
Week 3 看完了
Java的inheritance真的很清楚。发现之前的lab都没有做。
回复

使用道具 举报

🔗
 楼主| xxcindy 2021-4-11 01:40:58 | 只看该作者
全局:
做完了project 1b,费时1h多一点



回复

使用道具 举报

🔗
 楼主| xxcindy 2021-4-11 02:22:24 | 只看该作者
全局:
Week 4
看完了所有的lecture
- interface
  - one class can implement multiple interfaces
  - all methods are public
  - methods without "default" -> no body, must be overrided
  - methods with "default" -> has body, no need to re-implement
- abstract class
  - one class can extend only one class
  - can have private methods, any type of variables
  - methods without "abstract" -> has body, no need to re-implement
  - methods with "abstract" -> no body, must be overrided

- higher-order function: 必须要以class形式存在
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表