C#快速排序源码演示

如下的资料是关于C#快速排序演示的代码,应该对各位朋友有用处。

成都创新互联专业成都网站设计、网站建设,集网站策划、网站设计、网站制作于一体,网站seo、网站优化、网站营销、软文营销等专业人才根据搜索规律编程设计,让网站在运行后,在搜索中有好的表现,专业设计制作为您带来效益的网站!让网站建设为您创造效益。

private static int Partition (int[] list, int i, int j)
{
    int Key = list [i];

    while (i < j)
    {
        while (list [j] >= Key && i < j)
            j--;

        if(i< j)
            list [i++] = list [j];

        while (list [i] <= Key && i < j)
            i++;

        IF (i < j)
            list [j--] = list[i];
    }

    list [i] = Key;
    return i;
}
public static void QuickSort (int[] list, int low, int high)
{
    if(low < high - 1)
    {
        int Key = Partition (list, low, high);
        QuickSort (list, low, Key - 1);
        QuickSort (list, Key + 1, high);
    }
}

标题名称:C#快速排序源码演示
分享地址:http://hxwzsj.com/article/pehedg.html

其他资讯

Copyright © 2025 青羊区翔捷宏鑫字牌设计制作工作室(个体工商户) All Rights Reserved 蜀ICP备2025123194号-14
友情链接: 公司网站建设 成都响应式网站建设 网站建设公司 网站设计 重庆网站建设 古蔺网站建设 成都网站建设 网站建设推广 成都网站建设 企业网站建设公司 企业网站建设 成都定制网站建设 营销型网站建设 成都营销网站建设 外贸网站设计方案 高端品牌网站建设 成都响应式网站建设公司 成都网站建设推广 网站制作 成都商城网站建设 上市集团网站建设 成都网站设计公司