帮助气泡排序C# [英] Help with bubble sort c#

查看:77
本文介绍了帮助气泡排序C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用quicksort在列表框中对数据进行排序:

I am using quicksort to sort my data in a listbox:

ArrayList arr=new ArrayList();
arr.sort();
listbox1.datasource=arr;

但是如果我想使用冒泡排序,该怎么办?

感谢

But if I want to use bubble sort, what should i do?

Thanks

推荐答案

好吧,首先,您应该放弃ArrayList.如果您不使用.NET 1/1.1,则强类型列表通常是更好的选择.现在,如果要使用冒泡排序,则必须编写一个-BCL中没有内置的一个.

但是,您真的确定要冒泡排序吗?冒泡排序并不是最有效的排序方式.
Well, for a start, you should really ditch ArrayList. If you aren''t using .NET 1/1.1, a strongly typed list is generally a better proposition. Now, if you want to use a Bubble sort, you are going to have to write one - there''s not one built into the BCL.

But, are you really sure you want to Bubble sort? Bubble sorting isn''t the most efficient way to sort.


使用此链接

use this link

http://www.google.co.in/#hl=en&sclient=psy-ab&q=bubble%20sort%20program%20in%20c%23&oq=bubble%20sort%20c%23%20pr&aq=0b&aqi=g-b1g-C1g-vC1g-jC1&aql=&gs_nf=1&gs_l=hp.11.0.0i8j0i33j0i15i33j0i18i33.0.0.2.971.0.0.0.0.0.0.0.0..0.0.rsSCKjgFkZE&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=bc5f370e26149747&biw=1024&bih=625&pf=p&pdl=300[^]


请参阅:
www.devasp.net/net/articles/display/850.html

www.programcall.com/10/interview/write-一个示例程序,实现气泡排序在csnet.aspx中
Refer to this:
www.devasp.net/net/articles/display/850.html

www.programcall.com/10/interview/write-a-sample-program-that-implements-bubble-sort-in-csnet.aspx


这篇关于帮助气泡排序C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆