C#中的简单问题 [英] Simple question in c#
本文介绍了C#中的简单问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
谁能告诉我下面是什么样的东西:
Hi all,
can anyone told me that Kind of sort is it below:
string[] data = listbox1.Items.Cast<string>().ToArray();
ArrayList arr = new ArrayList();
foreach (string s in data)
if (!s.StartsWith(" "))
arr.Add(s);
arr.Sort();
listBox2.DataSource = arr;
我介意它是否可以调用快速排序或.... ??
thnx
I mind if it can call quick sort or....??
thnx
推荐答案
如果您问ArrayList.Sort使用哪种排序,它将使用Quicksort.
请参阅此链接中的备注"部分: http://msdn.microsoft.com/en-us/library/8k6e334t.aspx [ ^ ]
If you are asking what kind of sort is used by ArrayList.Sort, it uses Quicksort.
See the Remarks section in this link: http://msdn.microsoft.com/en-us/library/8k6e334t.aspx[^]
如解决方案1所述,mscorblib.dll的System.Array类的Sort方法内部使用了QuickSort,如下所示,
As mentioned in the solution 1, Sort method of the System.Array class of mscorblib.dll used QuickSort internally as showing below,
IL_0128: call instance void System.Array/SorterGenericArray::QuickSort(int32,
int32)
希望对您有所帮助:)
Hope it helps :)
这篇关于C#中的简单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文