专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅
网上搜到代码千篇律是这个 Function Sort(ary) Dim KeepChecking,I,FirstValue,SecondValue KeepChecking = TRUE Do Until KeepChecking = FALSE KeepChecking = FALSE For I = 0 to UBound(ary) If I = UBound(ary) Then Exit For If ary(I) > ary(I+1) Then FirstValue = ary(I) SecondValue = ary(I+1) [阅读全文] [PDF]
int t; int[] a ={21,56,64,94,97,123}; for(int j =a.Length-1;j>0;j--) { for(int i =0;i<j;i++) { if(a[i]>a[i+1]) { t =a[i]; a[i]=a[i+1]; a[i+1]=t; }}} for(int u =0;u<a.Length;u++) Console.WriteLine(a[u]); 结果:21,56,64,94,97,123 [阅读全文] [PDF]
C#实现的几种排序方法,比较经典,供大家参考使用   //选择排序,从小到大 by http://www.CrazyCoder.cn public static int SelectSort(int[] a) { int count=0;// 计算时间复杂度,运行的次数 int length = a.Length; int k= 0; int chan;//用来交换的中间变量 for(int i=0;i<length;i++) //需要更换的位置i { k =i; //初始化最大值的下标 for(int j=i;j<length;j++) / [阅读全文] [PDF]
1 共3条 分1页