标题:求希尔排序的算法
只看楼主
冲冲走过
Rank: 2
等 级:论坛游民
帖 子:69
专家分:72
注 册:2011-10-2
结帖率:91.67%
 问题点数:0 回复次数:3 
求希尔排序的算法
用c#写的希尔排序算法 !!!
搜索更多相关主题的帖子: 希尔 
2011-10-04 11:21
哦是菜鸟
Rank: 2
等 级:论坛游民
帖 子:40
专家分:15
注 册:2011-9-14
得分:0 
public static void ShellSort<T>(T[] array) where T : IComparable        {            int length = array.Length;            for (int h = length / 2; h > 0; h = h / 2)            {                //here is insert sort                for (int i = h; i < length; i++)                {                    T temp = array[i];                    if ((array[i -h]) < 0)                    {                        for (int j = 0; j < i; j += h)                        {                            if ((array[j]) < 0)                            {                                temp = array[j];                                array[j] = array[i];                                array[i] = temp;                            }                        }                    }                }            }        }
2011-10-05 00:06
哦是菜鸟
Rank: 2
等 级:论坛游民
帖 子:40
专家分:15
注 册:2011-9-14
得分:0 
http://
2011-10-05 00:08
冲冲走过
Rank: 2
等 级:论坛游民
帖 子:69
专家分:72
注 册:2011-10-2
得分:0 
谢谢三楼 你很给力!
2011-10-05 07:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-351558-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.065048 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved