// Sort.cpp : 排序算法测试模板 // #include "stdafx.h" #include <iostream> using namespace std; const int N = 10; void InsertSort(int *a, int len); void ShellSort(int *a, int len); void BubbleSort(int *a, int len); void QuickSort(int *a, int low, int high); int _tmain(int argc, _TCHAR* argv[]) { int a[N] = {49,38,65,97,76,13,27,49,55,4}; cout << "Before sort: "<<endl; for (int i = 0;i < N; ++i) { cout << a[i] << " "; } //InsertSort(a, N); //ShellSort(a, N); //BubbleSort(a, N); QuickSort(a, 0, N-1); cout << "\nAfter sort: "<<endl; for (int i = 0;i < N; ++i) { cout << a[i] << " "; } return 0; }