So I'm going to solve this by enumerate and check, which is an example of what's called a brute-force algorithm.
你懂的,所以我得靠列举和检验来解决这个问题,这就是我们说的穷举算法。
And check all of them. Try all of them. So you will see.
然后都看看,都尝尝。所以你会明白的。
Again, same kind of reasoning says, given some value x, I happened to pick a small one here, what's an easy way to do this? Well, let's just start at one. That's my variable I'm going to change and check.
好,尤其是,让我们到这里来,让我给大家看看第二个例子,让我把这个注释掉,这是我要解决的,第二个问题,假设我想找到一些整数的,所有除数,我想要找出来这个数的所有的除数。
Go to the web and check them out if you haven't already.
如果你还没在网上听过他们的节目,就赶紧去搜吧!
Because,you know,you can't trust me,and so you have to check me out and make sure I'm not lying to you.
因为你不能相信我,你要弄清楚我是否对你们撒谎了。
On page 174--Again, check and see if this is the same in your edition.
第174页,又一次,查看,这是不是与你们手中版本的页码一样。
It's 33, 32, it's only 32 times and you can check that math at home but here lies the power of algorithmic thinking, of computational thinking as they say.
你需要33,32,对,32次,你也可以在家里自己计算,但数学算法的力量是无穷的,这就是科学家们所谓的计算机思维。
And remember again, the binding energy physically is the negative of the ionization energy, and that's actually how you can experimentally check to see if this is actually correct.
电离能的负值,那个事实上是可以,通过实验来验证,它是否是对的,并且它等于负的。
You always want to check your signs at the and because it's so easy to get the sign wrong, and I was hoping that it was right here because I wasn't sure, but it turned out to be right.
我们完成计算时,一定要记得检查符号,因为很容易弄错符号,刚才我就不太确定,是否弄错了符号,检查发现没有问题。
And I called him up and I said, "Look, I'm going to go check out these other summer jobs but then I'll come visit you."
然后我给他回电,说,“我得查一下其他的暑期工,不过之后我会去看你的。“
And she's--and it's not the--and in fact, if you check the notes on the song, she's in fact, "The kind of girl you read about in new wave magazines."
而实际上,如果你去看歌曲的附注,实际上她是,"你在《新潮流》杂志中所读到的女孩"
We need to check another entrant from the outside, left wing or right wing, we need to check another entrant in the middle, there is only one possible one there, and there's a third kind of deviation we should check, what's the third type of deviation?
我们需要验证另外一个外部的参选人,左派或右派,我们需要验证另外一个中间的参选人,只有一个可能参选的人,还有第三种要验证的偏差类型,第三种偏差类型是什么
It's saying, "Remember, check it out, you want to do this and think about it carefully."
它是指,“记住,一定要好好确认,你需要把它做好,仔细考虑一下。”
And check the answers, and say yeah that's what we expected. But it also involves reasoning. About why that's an appropriate set of inputs to test it on it.
然后说对,这就是我想要的结果,但是它跟推理也有关系,表现在关于为什么这是一个,测试我们程序的适合的输入集。
And that you might look at, for example, that first example, and say, man by this stage it was already sorted, yet it had to go through and check that the third element was in the right place, and then the fourth and then the fifth and then the six.
你可能会去看看例如第一个例子,然后要抱怨,到这里,它已经是排好序的了,但他还是得去遍历查看,第三个元素是不是在正确的位置,然后第四个,第五个,第六个。
Having reached the end of the block, go back up and check the test.
执行到了这块代码的最后,程序会回去再做一次测试。
应用推荐