查看: 34394| 回复: 85
跳转到指定楼层
上一主题 下一主题
收起左侧

[Coursera] Algorithms (princeton) (week1) 讨论帖

 
全局:
公开课
学校名称: Princeton
Unit号: 1
开课时间: 2014-01-31
课程全名: Algorithms
平台: Coursera

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
本帖最后由 sanguine 于 2014-3-19 17:07 编辑

Honor code.   All students in the course must agree to abide by the Coursera honor code. In particular, do not post solutions or partial solutions to programming assignments; however, you are permitted to discuss general ideas and problem-solving approaches. You are also permitted to discuss solutions to exercises and job interview questions.
assignments不可以share code,但是exercise和job interview questions是可以的

讨论帖(该贴仅为week1讨论帖,加分贴请点这里)

课程汇总 && 介绍:http://www.1point3acres.com/bbs/thread-78774-1-1.html

Schedule:

Each Friday at 12:01pm EDT, we will release the course materials for the week: two lectures, two sets of exercises, a programming assignment, and two sets of job interview questions.


  • Exercises: due two weeks after they are released.
  • Programming assignments: due two weeks after they are released.
  • Job interview questions: for your own enrichment and not assessed.

Week 1

We begin our study of algorithms with a motivating example and an overview of the use of the scientific method for studying algorithm performance.

Lecture: Union-Find. We illustrate our basic approach to developing and analyzing algorithms by considering the dynamic connectivity problem. We introduce the union-find data type and consider several implementations (quick find, quick union, weighted quick union, and weighted quick union with path compression). Finally, we apply the union-find data type to the percolation problem from physical chemistry.

Lecture: Analysis of Algorithms. The basis of our approach for analyzing the performance of algorithms is the scientific method. We begin by performing computational experiments to measure the running times of our programs. We use these measurements to develop hypotheses about performance. Next, we create mathematical models to explain their behavior. Finally, we consider analyzing the memory usage of our Java programs.

Exercises. Drill exercises on the lecture material.

Programming Assignment: Percolation. Your programming assignment will give you an opportunity to apply these concepts to a fundamental problem in physical chemistry. It is the first of many examples where a good algorithm—in this case, weighted quick union—makes the difference between being able to efficiently solve a problem and not being able to address it at all.

Job Interview Questions. Algorithmic interview questions based on the lecture material.

Suggested readings. Section 1.4 and 1.5 in Algorithms, 4th edition.




上一篇:[stanford]Introduction to databases (week5)
下一篇:[Coursera] Algorithms (princeton) (week1) 加分贴
prelude 2014-2-4 11:40:32 | 只看该作者
全局:
说一下在Eclipse 中
import 两个API jar包的问题,通过Project - properties - Libraries - add external jars 后依然无法使用里面的API,是由于这两个Jar是default没有“路径”,eclipse没有办法去引用他们,所以要在  http://algs4.cs.princeton.edu/code/  页面下面下载
http://algs4.cs.princeton.edu/code/stdlib-package.jar
http://algs4.cs.princeton.edu/code/algs4-package.jar
然后add external jars,这样在java文件里添加
import edu.princeton.cs.algs4.*;
import edu.princeton.cs.introcs.*;
就可以了

点评

修正 见52楼  发表于 2014-2-16 11:45

评分

参与人数 5大米 +49 收起 理由
Jasmine_SJTU + 3 感谢分享!
绿爷 + 3 Get it ~
vincent0615 + 25 Thanks!
shindave + 3 赞
sanguine + 15

查看全部评分

回复

使用道具 举报

prelude 2014-2-10 07:34:24 | 只看该作者
全局:
本帖最后由 prelude 于 2014-2-10 07:36 编辑

Week1 作业:
关于在Eclipse中 用PercolationVisualizer.java 可视化结果的问题,首先你要把按规则写好的Percolation.java准备好,然后
在eclipse中确保这两个文件在同一个Package下,如果顺利将无编译错误。
这个PercolationVisualizer是要求有参数的,要读取本地的文件(文件可以从这里下载http://coursera.cs.princeton.edu/algs4/testing/percolation/)
然后在eclipse - run - run configuration - Arguments - programs Arguments里加上参数名 就是文件名比如说下载的文件为:input50.txt
然后这个input50.txt文件一定要放在project目录下,例如:我的默认workspace叫workspace,project名称叫2014Spring
那么就放到D:\Eclipse\workspace\2014Spring 就可以了!(和percolationvisualizer放到一个目录是没用的)


评分

参与人数 2大米 +20 收起 理由
sparrow52 + 10 谢谢你的介绍!
sanguine + 10 感谢分享!

查看全部评分

回复

使用道具 举报

 楼主| sanguine 2014-2-12 16:56:33 | 只看该作者
全局:
回复

使用道具 举报

推荐
ericcire 2014-2-7 20:28:05 | 只看该作者
全局:
竟然有一组数据是这样的。。。。。。

greeting57.png (34.88 KB, 下载次数: 60)

greeting57.png
回复

使用道具 举报

🔗
qiamoe 2014-2-3 12:42:23 | 只看该作者
全局:
本帖最后由 qiamoe 于 2014-2-3 22:00 编辑

没看明白assignment如果想用eclipse做要怎么搞
有没有大神懂的呀
============
啊。。总算把DrJava装好了...但是Eclipse不能用了
想问一下要怎么才能吧给的俩jar文件当API用呢。。。
之前脑残试了下extends WeightedQFU貌似不对。。。
求解答,渣渣不想在第一个assignment就倒下啊QvQ
回复

使用道具 举报

🔗
shindave 2014-2-3 22:32:40 | 只看该作者
全局:
qiamoe 发表于 2014-2-3 12:42
没看明白assignment如果想用eclipse做要怎么搞
有没有大神懂的呀
============

为啥不用eclipse
先装个JDK 7uxx
然后配置环境变量 http://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html
然后下个eclipse 注意如果你的JDK是x64的那么eclipse也要是x64 同理32位也一样
作业应只需上传两个java文件吧  打包
然后下下来两个附赠的jar 在你的新建项目中导入 http://blog.csdn.net/justinavril/article/details/2783182
然后就可以在你的工程里用jar的api了

评分

参与人数 1大米 +5 收起 理由
nibuxing + 5 多谢,很有用

查看全部评分

回复

使用道具 举报

🔗
qiamoe 2014-2-3 22:52:37 | 只看该作者
全局:
shindave 发表于 2014-2-3 22:32
为啥不用eclipse
先装个JDK 7uxx
然后配置环境变量 http://jingyan.baidu.com/article/6dad5075d1dc40a ...

╮( ̄▽ ̄")╭ 本来觉得既然是他推荐的会有什么福利来着,不过事实证明还是eclipse好用
谢谢啦~
还有请问把reference的jar导入之后要import什么才能去用是么?
回复

使用道具 举报

🔗
shindave 2014-2-3 23:23:46 | 只看该作者
全局:
qiamoe 发表于 2014-2-3 22:52
╮( ̄▽ ̄")╭ 本来觉得既然是他推荐的会有什么福利来着,不过事实证明还是eclipse好用
谢谢啦~
还有请 ...

是的 eclipse把鼠标放在红波浪线上可以按照提示来自动import
如果嫌麻烦,可以直接import xx.xxx.*
那个*的意思就是导入此包种的所有类
回复

使用道具 举报

🔗
 楼主| sanguine 2014-2-3 23:34:43 | 只看该作者
全局:
本帖最后由 sanguine 于 2014-2-4 11:18 编辑
shindave 发表于 2014-2-3 23:23
是的 eclipse把鼠标放在红波浪线上可以按照提示来自动import
如果嫌麻烦,可以直接import xx.xxx.*
那 ...

直接用快捷键ctrl+shift+O,可以导入所有缺失的import包,顺便删除没使用过的import包
回复

使用道具 举报

🔗
sylor 2014-2-4 05:08:59 | 只看该作者
全局:
shindave 发表于 2014-2-3 23:23
是的 eclipse把鼠标放在红波浪线上可以按照提示来自动import
如果嫌麻烦,可以直接import xx.xxx.*
那 ...

提示不出来import哪个啊。。。。手写我也不知道路径。。。。
PS:好烦啊,用啥外部jar包啊,还不给个api手册,蛋疼。。。。
回复

使用道具 举报

🔗
qiamoe 2014-2-4 10:21:26 | 只看该作者
全局:
sylor 发表于 2014-2-4 05:08
提示不出来import哪个啊。。。。手写我也不知道路径。。。。
PS:好烦啊,用啥外部jar包啊,还不给个api ...

同import不出来QAQ
回复

使用道具 举报

全局:
I have some problems about how to use algs4.jar and stdlib.jar . I have already insert jar files like this.  Then I don't know how to use command import to use the jar.file
回复

使用道具 举报

全局:
帅哥曲线救国 发表于 2014-2-4 11:02
I have some problems about how to use algs4.jar and stdlib.jar . I have already insert jar files lik ...

I will go back home later. I can't try your way to do that now.
回复

使用道具 举报

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

本版积分规则

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