OK, that's not so bad. Moving a stack of size 2 if I want to go there, I need to put this one temporarily over here so I can move the bottom one before I move it over.
好,并不那么难,移动上面两个圆盘的话2,我需要把最小的盘子,临时先放到多余的柱子上来,这样才能在把它移过来之前,把最底下的盘子放到目标柱子上。
So I know when I was in New York working as an intern I would go there every week
所以我在纽约当实习生的时候就知道,我每个礼拜都会去那里。
So I encourage you to go out there and find someone who you really disagree with.
我鼓励各位勇敢地,去寻找和你意见不同的人。
There are coffee machines and there are lounge sofas and everything else. There are computers, there are printers, so it's a good lounge, and I think if you go there one day a week to do your problem sets, or more often, that's a good meeting place,I recommend that.
那里还有咖啡机和舒适的大沙发,以及一些其它设施,比如电脑,打印机,真的是个很好的休息室,如果你每周去那里,花一天时间完成你的作业,或者多去几次,确实是个好地方,我强力推荐
So I have n operations log n times, n log n there we go, n log n. Took us a long time to get there, but it's a nice algorithm to have.
所以我log,n遍的n次操作,就得到了,虽然花了不少时间得到了这个结论。
so that's always something to look forward to when I go there.
所以我每次去都很盼着这个。
You might have already noticed that I'm using the classes V2 server so the syllabus is there, I'm going to go over the syllabus a little bit later, but the syllabus is available online.
你们可能已经注意到,我使用了班级服务器,所以课程大纲在这儿,虽然我待会儿会把这页内容翻过去,不过课程大纲已经挂在网上了
So I'd say, the farther north you go, there's no businesses.
所以我说,你越往北走,就越看不到商业机构了。
so I'll like to go there and find out for myself.
所以我还是会去那里,看看情况到底怎样。
So I know it's also pretty cheap to go there.
而且我知道去一趟也不贵。
So I try and go there as often as possible.
所以,我尽可能经常去。
So, there was just obvious a puzzle that I had to go into.
所以这就像个迷题,我必须去破解。
So how would we go about solving this problem if I told you not only was there a maximum weight, but there was a maximum volume. Well, we want to go back and attack it exactly the way we attacked it the first time, which was write some mathematical formulas.
有些时候两个都重要,所以如果我告诉你这里不仅有,最大重量还有最大容量,我们应该怎么解决这个问题呢?,好了,我们想回过来然后,和第一次一样看看这个问题。
Yeah, if my machine will come back up, there we go. So, I'm going to now go ahead and write a little piece of code, and I put it here and I hope you can actually see these better this time, let me uncomment that region.
让我们写出代码来吧,好,如果我的电脑能回来的话,好了,那么,我要去写一小块代码,我把它放在这里以期望大家这次,能看的更清楚点。
I'm going to go there initially, so I can move this over here, so I can get the base part of that over there, I want to put that one there before I put this over here, finally I get to the point where I can move the bottom one over now I've got to be really careful to make sure that I don't cover up the bottom one in the wrong way before I get to the stage where I wish they were posts and there you go.
我要先把其他的放到多余的柱子上,然后把最底下的放到目标柱子上,我要在把除了最底下的圆盘,其他的圆盘挪过来之前,把最下面的圆盘放在这儿,因此我得出了最下面的盘子,应该如何摆放的结论,当我没得到其他盘子的正确摆放位置的时候,要很小心的确认没把错误的盘子,放在最下面的盘子上面。
All right? So if I called sqrt alone, that return test value is done, but in this case I bound it to test, so I can go look at test, and there it is.
执行完返回值语句,但是在这里我将把它赋值给,所以当我看test的值的时候就是返回的值。
应用推荐