未排序的列表可以包含任何想要的数据。
验证排序的列表是否正确(即使它们包含重音符号)。
Verify that sorted lists are correct, even if they include accented characters.
在这个示例中,结果列表是每个片各自排序的列表的合并版本。
In this example, the resultant list is a merged version of the individually sorted lists from each slice.
You'll also notice that this thing goes through the entire list, even if the list is sorted before it gets partway through.
你也能注意到,它始终会遍历列表,甚至列表在排序之前,就是有序的也是这样。
I haven't said how I'm going to get those sorted lists, but imagine I had two sorted lists like that.
我还没有说明我怎么才能得到已排序的列表,但是想像一下我现在已经有,两个已排序好序的列表了。
If it was an unordered list, we were basically stuck with linear search. Got to walk through the whole list to see if the thing is there.
如果是一个未排序的列表,基本上我们就只能使用线性搜索了,通过遍历整个列表来查看。
应用推荐