The idea behind all these algorithms is that what's ultimately important is how many comparisons you ultimately need to make.
这些算法的思想是,你最终需要做多少次的比较,这才是真正重要的。
And in fact in one with the girl describing her side, she several times emphasizes this need for protection, need to be free from being torn down from people around them.
事实上像一个女孩子表达的那样,她好几次强调了需要保护的愿望,需要逃离那些打倒她的东西,逃离身边的人们。
And I had mentioned several times thatyou do not need to memorize the majority of the equations and you don't need to memorize any physical constants.
另外我已经提过好几次了,绝大多数的公式大家都不需要去背,也不用去记任何物理常数。
They said they were important for pious instruction.
他们称需要从自己的正经里去除次经。
It took me seven comparisons, because I can take advantage of the fact I know I only ever have to look at the first element of each sub-list. Those are the only things I need to compare, and when I run out of one list, I just add the rest of the list in.
进行了7次对比,因为我可以利用我知道的优势:,每次只需要比较每个子列表的第一个元素,那才是我需要进行对比的内容,当一个列表的元素处理完了,只需要将另一个列表剩下的元素直接添加进去。
N Well, here is a list of size N. How many times can you divide a list of size N by 2, right?
这是一个大小为N的列表,将一个大小为,的列表除以2需要几次呢?
It would be nice if it was less than linear, but linear is nice because then I'm going to get that n log in kind of behavior.
那么就是一个不错的算法,但是线性方案也是很好的,因为我需要做n次的log级的行为。
I was just finding very tunnel vision-like, the smallest elements at that moment in time which means I don't know anything about the other elements other than they are not the smallest and so no matter what with Selection Sort I had to repeat this again and again and again and if you do out the math it's roughly N squared steps in the worst case as well.
我只有一个狭窄的视野,只知道某时刻的最小元素,就意味着我并不知道其他元素的任何情况,只知道它们不是最小的,所以不管怎样,在选择排序中,我就得一遍一遍地重复选择过程,在最坏情况下,大概需要N的平方次比较。
应用推荐