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

Berkeley CS 61B Data Structures(in Java) Homework4 加分+讨论帖

 
🔗
weirdzrx 2016-9-18 01:50:11 | 只看该作者
全局:
另外还想问大家一下,我在把DListNode对象cast成LockDListNode对象后,如果想调用LockDListNode中特有的method或fields为什么一定要用:
((LockDListNode)node).isLocked = true;
来进行操作而不能使用
node = (LockDListNode) node;
node.isLocked = true;

第二种会在编译时显示找不到isLocked这个field
回复

使用道具 举报

🔗
hdx1993 2016-9-18 07:19:02 | 只看该作者
全局:
费了老劲啦,看了github的一些代码感觉清楚了很多,不然自己有一些问题总是很难解决
更多图片 小图 大图
组图打开中,请稍候......

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
Liam23 2016-9-22 07:43:07 | 只看该作者
全局:
拖了好久,恢复开工



更多图片 小图 大图
组图打开中,请稍候......

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
nsc 2016-10-1 15:50:34 | 只看该作者
全局:
提交hw4作业
谢谢!

更多图片 小图 大图
组图打开中,请稍候......

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
tibby2009 2016-10-6 23:36:20 | 只看该作者
全局:
交HW4 的作业, 做了很长时间这次

hw4.png (72.57 KB, 下载次数: 0)

hw4.png

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
wlfjqcj 2016-10-19 23:07:28 | 只看该作者
全局:
有人知道如何compile吗?为何按照提示
  javac -g list/DListNode.java
我总是compile不成功。。
terminal出错提示如下:
javac: file not found: list/DListNode.java
Usage: javac <options> <source files>
use -help for a list of possible options
回复

使用道具 举报

🔗
李大侠 2016-10-26 13:56:41 | 只看该作者
全局:




评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
supersam1993 2016-10-27 21:59:01 | 只看该作者
全局:
先看了下前面大神的归纳 做起来很顺
part3 主要注意的是
1.子类构造出来的本质还是LockDListNode 只是传出来的是临时的DListNode 这样不会打乱父类本身适应
2.子类尽量不要重新定义field 本来挺好 画蛇添足将子类的prev next定义了LockDListNode。 因为平时都是以父类的临时身份用父类的prev next(与子类的不同) 突然转到子类 就gg了。 所以还不如和父类一起共用 prev next

有大神说下 part2 讲了什么吗?
更多图片 小图 大图
组图打开中,请稍候......

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
Susan1013 2016-11-14 21:57:06 | 只看该作者
全局:
感谢大牛指点。
更多图片 小图 大图
组图打开中,请稍候......

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

🔗
闲的时光 2016-11-19 10:42:25 | 只看该作者
全局:
传不了图片
1.
Now we are testing DList.
Here is a list after insertBack 6, 9, 12: [  6  9  12  ]

Here is the same list after insertBack(15) and insertFront(3): [  3  6  9  12  15  ]

front() should be 3. It is: 3
front's next should be 6. It is: 6
front's next's prev should be 3. It is: 3
After remove the front, the front() should be 6. It is: 6
After insertBefore() and insertAfter(), The first 3 nodes should be 5,6,8. The list is: [  5  6  8  9  12  15  ]

Here is a list after construction: [  ]
isEmpty() should be true. It is: true
length() should be 0. It is: 0
Here is a list after insertFront(3) to an empty list: [  3  ]
Here is a list after insertBack(5) on an empty list: [  5  ]

Here is a list after insertFront 3, 2, 1: [  1  2  3  ]
isEmpty() should be false. It is: false
length() should be 3. It is: 3
Here is the same list after insertBack(4): [  1  2  3  4  ]

Here is a list after insertBack 6, 7: [  6  7  ]
isEmpty() should be false. It is: false
length() should be 2. It is: 2
Here is the same list after insertFront(5): [  5  6  7  ]

2.
Now we are testing LockDList.
Here is a list after insertBack 6, 9, 12: [  6  9  12  ]

Here is the same list after insertBack(15) and insertFront(3): [  3  6  9  12  15  ]

front() should be 3. It is: 3
front's next should be 6. It is: 6
front's next's prev should be 3. It is: 3
We lockNode front()= 3
After remove the locked front, the front() should still be 3. It is: 3
After remove the back, the back() should be 12. It is: 12
After insertBefore(3) and insertAfter(3), The first 3 nodes should be 5,3,8. The list is: [  5  3  8  6  9  12  ]

Here is a list after construction: [  ]
isEmpty() should be true. It is: true
length() should be 0. It is: 0
Here is a list after insertFront(3) to an empty list: [  3  ]
Here is a list after insertBack(5) on an empty list: [  5  ]

Here is a list after insertFront 3, 2, 1: [  1  2  3  ]
isEmpty() should be false. It is: false
length() should be 3. It is: 3
Here is the same list after insertBack(4): [  1  2  3  4  ]

Here is a list after insertBack 6, 7: [  6  7  ]
isEmpty() should be false. It is: false
length() should be 2. It is: 2
Here is the same list after insertFront(5): [  5  6  7  ]

评分

参与人数 1学分 +1 收起 理由
yingy4 + 1

查看全部评分

回复

使用道具 举报

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

本版积分规则

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