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

Berkeley CS 61B Data Structures(in Java) Lab4 讨论帖

 
🔗
CindyChen 2015-2-20 02:51:47 | 只看该作者
全局:
第一张图test了两次,第一次忘了链表为空时size的状况~~
回复

使用道具 举报

🔗
ryanli 2015-3-12 09:33:40 | 只看该作者
本楼:
全局:
交个作业!
更多图片 小图 大图
组图打开中,请稍候......
回复

使用道具 举报

🔗
AveMaleficum 2015-3-25 06:59:53 | 只看该作者
全局:


很好的lab,让人对null pointer的exception有了更加深刻的认识,另外对于circled list的方便也有了更好的认识。好lab。




回复

使用道具 举报

🔗
rockleecsu 2015-4-3 12:12:55 | 只看该作者
全局:
搞定了。。一天跟3堂课!!加油!!


回复

使用道具 举报

🔗
norafang 2015-4-8 15:03:47 | 只看该作者
本楼:
全局:
跟上~~~~~~~~~
更多图片 小图 大图
组图打开中,请稍候......
回复

使用道具 举报

🔗
mming1993 2015-4-8 16:26:05 | 只看该作者
全局:
### TESTING insertFront ###
Empty list is [  ]

Inserting 9 at front.
List with 9 is [  9  ]

Inserting 8 at front.
List with 8 and 9 is [  8  9  ]


### TESTING removeFront ###
List with 1 and 2 is [  1  2  ]

Removing front node.
List with 2 is [  2  ]

Removing front node.
Empty list is [  ]

Removing front node.
Empty list is [  ]
回复

使用道具 举报

🔗
mming1993 2015-4-8 17:25:00 | 只看该作者
全局:
### TESTING insertFront ###
Empty list is [  ]

Inserting 9 at front.
List with 9 is [  9  ]

Inserting 8 at front.
List with 8 and 9 is [  8  9  ]


### TESTING removeFront ###
List with 1 and 2 is [  1  2  ]

List with 2 is [  2  ]

Empty list is [  ]

Empty list is [  ]
回复

使用道具 举报

🔗
whdawn 2015-4-9 02:04:08 | 只看该作者
全局:
这次的好简单,交个作业~



回复

使用道具 举报

全局:
本帖最后由 乐百氏开开心心 于 2015-4-11 11:30 编辑
whdawn 发表于 2015-4-9 02:04
这次的好简单,交个作业~

可以咨询一下removeFront()方法你是怎么写的吗?纠结了好久没做好。。总是不行。好像不完整。

public void removeFront() {
    // Your solution here.
      if(head != null){
       head = head.next;
          size --;
      }
    }
回复

使用道具 举报

🔗
whdawn 2015-4-14 00:56:34 | 只看该作者
全局:
乐百氏开开心心 发表于 2015-4-11 11:14
可以咨询一下removeFront()方法你是怎么写的吗?纠结了好久没做好。。总是不行。好像不完整。

publi ...

我猜你说的是DList2吧,这是我的解法:
  
public void removeFront() {
          if(size > 0) {
                  DListNode2 node = head.next.next;
                  head.next = node;
                  node.prev = head;
                  size--;}
  }
回复

使用道具 举报

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

本版积分规则

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