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

uc berkeley CS 61B homework 9

 
🔗
SelinaMY 2016-7-25 14:37:16 | 只看该作者
全局:
在怎么用一维数组表示cells和walls上卡了一阵子,想清楚怎么进行编码后,按照老师提示的思路一步步完成便没有什么大问题。


评分

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

查看全部评分

回复

使用道具 举报

🔗
jacketsu 2016-7-25 23:04:40 | 只看该作者
全局:
老师的提示比较好,不过可怜我还是个编码苦手,继续努力

捕获1.PNG (23.66 KB, 下载次数: 0)

捕获1.PNG

评分

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

查看全部评分

回复

使用道具 举报

🔗
fishgo 2016-8-17 22:46:30 | 只看该作者
全局:
挺有意思的,没想到disjointed set还能这么用。必须吐槽一下readme,啰啰嗦嗦说了一大堆,读了好几遍才理解

1.png (9.4 KB, 下载次数: 0)

1.png

评分

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

查看全部评分

回复

使用道具 举报

🔗
farewell 2016-8-23 17:22:33 | 只看该作者
全局:
union时候要保证用root,不然就栈溢出,哎,我真是不会编程星人呜呜呜

评分

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

查看全部评分

回复

使用道具 举报

🔗
zzdsg 2016-8-25 22:36:33 | 只看该作者
全局:
这次作业不太难,就差最后一次作业啦!加油!

9.png (73.25 KB, 下载次数: 0)

9.png

评分

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

查看全部评分

回复

使用道具 举报

🔗
minchen57 2016-10-25 05:23:18 | 只看该作者
全局:
交作业!!!



第二部分这样想的:
1. initialize: the same as the hw, all walls are present (true), no cells are connected, every cell is labelled unvisited (vistited = false)
1. start: randomly choose one cell as the starting point, change visted to true
2. starting dfs: for all the neighbors (3 of them),
          if wall between this cell and the neigbor is true, and the neigbor is vot visitied,    (the condition garantees that every pair is has only one path)
                   break this wall and set the neighbor to be visited.   
                   recursively run dfs on this neigbor   (dfs makes sure that every cell is considered, i.e either break the wall or path already exists)

(random starts and random selects neighbors is sufficient for the required randomness of the maze)

评分

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

查看全部评分

回复

使用道具 举报

🔗
李大侠 2016-10-25 09:10:14 | 只看该作者
全局:

评分

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

查看全部评分

回复

使用道具 举报

🔗
wd370175609 2016-11-29 21:06:28 | 只看该作者
全局:
交作业啦~继续坚持!!!!!!

1111111.png (6.89 KB, 下载次数: 0)

1111111.png

评分

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

查看全部评分

回复

使用道具 举报

🔗
闲的时光 2016-12-6 15:14:13 | 只看该作者
全局:
Readme的内容一开始没看懂,浪费了很多时间,看懂了发现按照提示做就可以了。

评分

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

查看全部评分

回复

使用道具 举报

🔗
mjtyumi 2016-12-11 18:09:39 | 只看该作者
全局:
想不到disjoint sets有这种运用,太有意思了。
这次思路很简单,我建立了一个string array来直接记录两类墙的坐标和类别,反推的时候还蛮方便的。

评分

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

查看全部评分

回复

使用道具 举报

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

本版积分规则

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