And it's just gathering together the multiplications while counting down the exponent. And you can see it when we get down to the end test here, we're going to pop out of there and we're going to return the answer.
这个方法就是通过乘法,来一个一个的减小指数,可以看到,最后面的结果测试,我们会在这里退出,然后返回答案。
You know, if you're wandering through Harvard Square and you see an out-of-work Harvard grad, they're handing out examples of square roots, they'll give you an example and you can test it to see is the square root of 2, 1.41529 or whatever.
你知道,如果你从哈佛校园里穿过去,你看见了一个失业校友,正在派发平方根的示例,他们会给你一个例子,而你会检查2的平方根是1。41529或者别的什么。
Let's check it out. I've written a little bit of a test script here, so if we test cell sort, and I've written this so that it's going to print out what the list is at the end of each round, OK.
我们来检查检查,我写了一个小测试脚本,我写这个脚本来测试单元排序,它能够打印出每一轮结束后,链表的是什么样子的。
OK.Let's look at the code-- actually, let's test this out first before we do it.
因此我已经添加了,就像Guttag教授做的那样-啊,应该这么说。
应用推荐