![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
崖高人远
这个作者很懒,什么都没留下…
展开
-
快速排序,优化
//快速排序 优化型 //没有采用交换,而是使用的赋值。 #include using namespace std; void print(int * a,int n) { for(int i = 0;i < n ; i++) { cout << a[i] << ' ' ; } cout << endl; } void sort(int *a,int n) { if(n<1)转载 2012-10-11 00:49:24 · 365 阅读 · 0 评论 -
插入排序
#include #include using namespace std; void print(int * a,int n) { for(int i = 0; i < n; i++) { cout << a[i] << ' ' ; } cout << endl; } void sort(int * a, int n) { for(int i = 1; i < n;i++)转载 2012-10-10 23:47:32 · 475 阅读 · 1 评论 -
快速排序
//快速排序 #include using namespace std; void print(int * a,int n) { for(int i = 0;i < n ; i++) { cout << a[i] << ' ' ; } cout << endl; } void sort(int *a,int n) { if(n<1) { return ; } int转载 2012-10-11 00:43:11 · 338 阅读 · 0 评论 -
冒泡排序、优化
#include using namespace std; void print(int * a,int n) { for(int i = 0; i < n; i++) { cout << a[i] << ' '; } cout << endl; } void sort(int * a,int n) { for(int i = 0; i < n; i++) { bool转载 2012-10-10 22:05:14 · 406 阅读 · 0 评论 -
冒泡排序
#include using namespace std; void print(int * a,int n) { for(int i = 0; i < n; i++) { cout << a[i] << ' '; } cout << endl; } void sort(int * a,int n) { for(int i = 0; i < n; i++) { for(i转载 2012-10-10 21:47:13 · 348 阅读 · 0 评论 -
选择排序
//选择排序 #include using namespace std; void print(int * a,int n) { for(int i = 0; i < n ; i++) { cout << a[i] << ' '; } cout << endl; } void sort(int * a, int n) { for(int i = 0; i < n - 1; i转载 2012-10-10 22:56:25 · 456 阅读 · 1 评论