So, let's do a little sanity check now and let's try to demonstrate as much I now claim I'm going to capitalize the copy of the string I just made.
多以,让我们做一个检查,然后做一个演示,现在我声称,我要利用那个字符串的拷贝。
It would definitely be wrong if we were doing this because little sanity check if you just got the single one it means what instead?
如果我们这样做就是错误的,一个小检查,如果你用单个“=“,是什么意思?
First, I'm going to do a sanity check strlen so we've used string length, strlen, before.
首先,我先做一个检查,我们以前使用过字符串长度函数。
Glancing at the bottom, this is pretty arbitrary, but I chose to format my string as follows: % 1f so at the bottom here I'm printing out %.1f, which quick sanity check means print just one digit after the decimal place.
看下这个底部,这个是相当随意的,但我选择把我的字符串格式化成这样:,所以在这个底部我打印输出,提醒一下,这是一个只打印出,小数点后一位的方法。
We'll use more sophisticated tools before long, but let's do a little sanity check.
我们不久后将用更多的复杂的工具,但是让我们做一个明智的检查。
So just as a little sanity check, number 15 in binary would be?
再来做个测试,那么二进制中15怎样表达?
And so can we do a little sanity check with the simple case here?
对这个简单的例子我们能不能做完整性检查呢?
I need that sanity check saying at some point, you have to stop.
在一些地方需要做那样的合法性检查,告诉你必须停止操作。
This is our little sanity check, the base case.
这是合法性检查,是基本条件。
So I have a little sanity check now.
我们现在做了一个明智的检查。
So let's do a little sanity check.
让我们做一个明智的检查。
So now a sanity check.
现在做一个检查。
So a little sanity check.
做一个检查。
I then do a sanity check.
然后我做一个检查。
N log N is not nearly as good as log N. As a sanity check, what algorithm have we seen that runs in log N time?
而N,log,N和log,N并不一样,我们之前探讨过的哪个算法其时间复杂度是log,N呢?
So supposed that I give you 16 elements to sort, well, following the logic before, the running time involved in sorting 16 elements is gonna be twice the running time 16 of sorting 8 elements, left half and right half plus 16 - and again, a little sanity check, 16 means-- just the merge steps, right?
现在要对16个元素进行排序,根据之前的逻辑,对16个元素排序,要花的时间是对8个元素排序所花时间的,2倍,分别用于左半部分和右半部分,再加上6,这里16是-,做合并的步数,对吗?
include stdio h The next line of code says include standard io.h which just as a little sanity check contains among other things, printf.
接着的一行代码写着,这个库文件包含一些我们常用的函数,譬如,printf函数。
So don't underestimate the value for the next week or two of just inserting printf statements into your code temporarily just to print out what the value of some variable is, or some expression is, so that you can just do a sanity check.
所以不要低估下一两周的重要性,虽然我们只将“printf“语句暂时地植入到,我们的代码中,只是用来打印一些,变量或表达式的值,所以你们提醒一下自己。
But that merging process only takes N steps, N*log N so that's N times log of N. Now, it's a little tricky to reason through this perhaps the first time, let's just take a very simple example and see if we can do a little sanity check here.
但这个合并过程只需要N步,所以时间复杂度是,第一次对此进行推论可能会有点儿棘手,我们举一个简单的例子,看看我们能否做一些完整性的检查。
dot slash hello" runs the program what do we often see if you omit -- little sanity check -- the "dot slash" ?
,/hello“是用来运行程序的,我们经常看到的,如果你省略--作为一点提醒--那个“,/“呢?
应用推荐