These things run for variable amounts of time because they take input, a list of size of some amount.
而这一段的执行时间是可变的,因为它们需要输入一个包含一些元素的列表。
OK, what I would like you to see is I've been printing out, as I went along, actually let's back up slightly and look at the code. There's merge sort.
好的,我想让你们看就是我运行过后,打印出来的结果,我们再回头看一下这段代码,这就是归并排序,输入一个列表。
I can't rely on Professor Guttag if I give this- if this code to him, I can't rely on him to type in a float. Actually I can, because he's a smart guy, but in general, I can't rely on the user-- I wouldn't do it right to see if you did.
当Guttag使用这段代码的时候-,我不能相信他一定会输入一个浮点数,实际上我能因为他很聪明,但是总体上来讲,别相信用户一定会按照规则来-,我会故意做错来试试你的程序的。
应用推荐