爱学习的站长www.mmic.net.cn

www.mmic.net.cn 欢迎学习共同成长
公告信息
www.mmic.net.cn 欢迎学习共同成长
文章分类
文章档案
文章
测试排序算法样板方法
2011/8/8 13:16:46
#include "stdafx.h"   
#include <iostream>   
using namespace std;  
  
const int N = 10;
  
void InsertSort(int *a, int len);
void ShellSort(int *a, int len);
  
int main()   
{  
    int a[N] = {49,38,65,97,76,13,27,10,22,55};
    cout << "Before sort: "<<endl;
    for (int i = 0;i < N; ++i)
    {
        cout << a[i] << " ";
    }
  
    //InsertSort(a, N);
    ShellSort(a, N);
  
    cout << "\nAfter sort: "<<endl;
    for (int i = 0;i < N; ++i)
    {
        cout << a[i] << " ";
    }
    return 0;  
}
引自:http://pdflist.mmic.net.cn
新浪微博粉丝精灵,刷粉丝、刷评论、刷转发、企业商家微博营销必备工具"
 技术   浏览(1820)   评论(0)   关键字
  
Copyright © 2010-2020 power by CYQ.Blog - 秋色园 v2.0 All Rights Reserved