Because Select() overwrites its arguments, the caller must make a copy of each list before passing it to Select(). This is inconvenient and does not scale well: servers frequently need to monitor hundreds of sockets so, on each iteration, the code has to copy the lists before calling Select().
基于1个网页-相关网页
Think of the time you might waste on each iteration.
那么您可以想象一下在这上面您要耗费多长的时间。
On each iteration, db2_result gets the value for each field within the row.
在每次迭代中,db 2 _ result将获取行内每个字段的值。
It then iterates over this table list, dynamically generating a new elements array on each iteration.
然后迭代此表列表,动态地针对每个迭代生成一个新的elements数组。
> So now that might not have felt like the fastest algorithm but think about what you could have done with that algorithm in each iteration, much like the phonebook up front here, you literally split that problem in two because on each iteration roughly half of you were sitting down and then another half and then another half.
虽然这并不是最快的算法,但如果把这种算法每次迭代,就像刚才查电话簿一样,你便将这个问题一分为二了,因为每一次迭代后只有一半坐下来,以此类推。
So if on each iteration of merging I'm doing eight things or more generally, N. That then begs the question, how many levels of this tree are there actually?
可见对于合并我需要迭代8次,一般情况下是N,这取决于具体问题,那么在这棵树中一共有多少层呢?
And in this case, we go from 8 to 4 to 2 to 1 three times and then on each iteration of this algorithm, each pass across the board I'm touching N numbers, so that means I'm doing N things, log N times.
在这个例子中,我们从8得到4,到2,再到1,是3次,在这个算法的每次迭代中,每一趟我都会操作N个数,也就是所我每次要做N步操作,一共要做,log,N,次。
应用推荐