Now, what did I want to do? I wanted to check membership. I want to do search. Well that's simple. Given that representation and some value, I just say gee is it there?
现在,我需要做什么?,我要做成员检查,我要做查找,这就很简单了,给了即定的表示和一些值,我只需要说喂在那儿吗?
And in fact, as a sidebar, that is not syntactically correct, there's a simple button that you push that will check your syntax.
实际上,有个小道消息,你放入了,一个语义,结构。
And so can we do a little sanity check with the simple case here?
对这个简单的例子我们能不能做完整性检查呢?
I spotted an error here, I could have spotted it by running it on different test sets, and using prints things, another way of doing it, but this idea of at least simulating it on simple examples lets you check a couple of important questions.
操作么?我在这里发现了一个错误,我也可以通过运行不同的测试集,或者运用print声明来发现这个错误,但是至少应该用简单的例子来手工模拟下,代码的思想可以让你,对一些很重要的问题进行检验。
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步,所以时间复杂度是,第一次对此进行推论可能会有点儿棘手,我们举一个简单的例子,看看我们能否做一些完整性的检查。
应用推荐