自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 排序系列之四 计数排序

计数排序顾名思义 通过计算某数在数组中的位置来确定其次序,是一种非比较的排序方法,且用下面的算法是稳定的。------算法导论学习笔记void countSort(int a[],int b[],int k){//k is more bigger than any members in a; int c[k]; for(int i=0;i<k;i++){

2013-09-21 09:57:58 332

原创 排序系列之三快速排序(递归每次选择数组中末尾数为基准)

#include using namespace std;void swap(int &a,int &b) {int temp=a; a=b; b=temp;} int partition(int a[], int p,int r){ int x=a[r]; int i=p; for(int j=p;j<r;j++){ if(a[j]<=x){ swap(a[

2013-09-14 21:46:07 922

原创 排序系列之二堆排序的非递归算法

#include using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int parent(int i){//此处数组从1开始 a[0]设置为0; return i/2;}int lchild(i

2013-09-14 10:32:21 479

原创 排序系列之一冒泡排序

学习日记,记此博客记录void swap(int &a,int &b){//交换俩数a=a+b;b=a-b;a=a-b;}void bubble(int a[],int size){coutfor(int i=size-1;i>=0;i--){for(int j=i-1;j>=0;j--){if(a[i]swap(a[i],a[j]);}}}

2013-09-13 23:43:41 388

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除