自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 八大排序所花时间测试序列(线性复杂度居然干不过log复杂度?)(采用的C++,结构体排序)

首先是测试前准备整体思路:生成1000个随机的字符串,如果字符串相同长度,就按字典序从小到大,否则,按照字符串长度从小到大排序,对于每一种方法,都用clock()函数记录总体时间,最后进行汇总首先是代码准备:#include<iostream>#include<string>#include<vector>#include<time.h>#include<algorithm>#include<map>#include

2021-03-31 19:19:40 1145 2

原创 大顶堆的插入和删除(C语言)

#include<stdio.h>#include<math.h>#include<stdlib.h>#include<time.h>const int MAXN = 10000;struct Data{ int id = 0;};struct Heap{ Data data[MAXN]; int size; Heap() { data[0].id = _CRT_INT_MAX; size = 0; }};void I

2021-03-26 23:20:04 632

原创 二叉搜索树的插入和删除(附带随机数测试)(C语言实现)

#include<stdio.h>#include<stdlib.h>#include<time.h>struct Data{ int id;};struct STree{ Data data; STree* left; STree* right;}*head= NULL;void travel(STree* now, Data data);void insert(STree** head, Data data);STree* find_m

2021-03-26 21:06:35 302

原创 完全二叉树的生成,以及前中后序遍历(递归或者非递归都有)(C++类实现)

#include<stdio.h>#include<stdlib.h>#include<stack>#include<queue>using namespace std;struct Data{ int id;};struct Node{ Data data;//数据 bool isprint = 0;//后序非递归判断是否被打印 Node* left;//左孩子 Node* right;//右孩子 Node* prev;//父亲

2021-03-26 16:06:08 122

原创 基于随机数的二分查找(C语言+stl实现)

#include<stdio.h>#include<stdlib.h>#include<time.h>#include<algorithm>using namespace std;const int MAXN = 10000;int a[MAXN - 1];int main(){ srand(time(0)); //给a数组赋予MAXN个随机数 for (int i = 0; i <= MAXN - 1; i++) { a

2021-03-24 21:46:15 340

原创 多项式相加队列法(附带队列的链式存储实现)

#include<stdio.h>#include<stdlib.h>struct Data{ double ratio;//系数 int index;//指数};struct Node{ Data data; Node* next;};Node* head1 = NULL;Node* head2 = NULL;Node* headsum = NULL;struct QNode{ Node* front; Node* rear; };void

2021-03-24 21:09:38 227

原创 队列的链式存储(C语言+一点点C++实现)

#include<stdio.h>#include<stdlib.h>struct Data{ int id;};struct Node{ Data data; Node* next;};Node* head = NULL;struct QNode{ Node* front; Node* rear; };void in_quene(QNode* quene, Data data);Data* out_quene(QNode* quene);in

2021-03-24 20:17:59 75

原创 统计单词个数并排序(C with stl)

#include<stdio.h>#include<string.h>#include<stdlib.h>#include<algorithm>using namespace std;const int MAXN = 2000000;//文章的最大字符数const int MAXW = 20;//单词的最大字符数bool isletter(char c);struct Word{ char word[MAXW]; int n;}wor

2021-03-24 17:13:37 364

原创 中缀表达式转后缀表达式(C with stl)

```cpp#include<iostream>#include<stdio.h>#include<string.h>#include<map>#include<string>using namespace std;struct Data{ char sym;};struct Stack{ Data data; Stack* next;};bool pop_stack(Data data, Stack** T.

2021-03-24 17:02:42 450

空空如也

空空如也

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

TA关注的人

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