自定义博客皮肤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)
  • 收藏
  • 关注

原创 原始的归并排序代码实现cpp

原始的归并排序 template <class Type> void Merge(Type a[],Type t[],int l,int mid,int r){ int i = l,j = mid+1; int k = 0; while(i<=mid&&j<=r){ if(a[i]<=a[j]){ t[k++]=a[i++]; } else {

2020-12-03 15:31:45 92

原创 希尔排序的代码实现cpp

希尔排序 template <class Type> void InsertSort(Type a[],int n,int d){//插入排序 for(int i=d;i<n;++i){ for(int j=i-d;j>=0;--j){ if(a[j]>a[j+d]){ swap(a[j],a[j+d]); } } } } template <c

2020-12-03 15:30:44 85

原创 堆排序的代码实现(大根堆\小根堆)cpp

堆排序 #define LT(a,b) ((a) < (b))//大根堆 顺序 #define RT(a,b) ((a) > (b))//小根堆 逆序 template<class Type> void HeapAdjust(Type a[],int s,int m){//调整堆 Type rc = a[s];//顶端a[s] for(int i=2*s;i<=m;i*=2){ if(RT(a[i],a[i+1])&&i<m

2020-12-03 15:28:40 249

原创 字典树(Trie)的两种基本操作代码实现cpp

存储方式: struct node{ int next[26]; int cnt;//节点出现次数 }trie[size]; 插入: void insert(struct node *trie,char *str) { int now=0; for(int i=0;str[i];++i) { int t=str[i]-'a'; ...

2020-04-05 13:51:05 174

空空如也

空空如也

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

TA关注的人

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