![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c
心心喵
这个作者很懒,什么都没留下…
展开
-
[c] 数组初始化的三种方法({0},memset, for循环)
参考:https://www.cnblogs.com/fnlingnzb-learner/p/8057257.html #define ARRAY_SIZE_MAX (1*1024*1024) void function1() { char array[ARRAY_SIZE_MAX] = {0}; //声明时使用{0}初始化为全0 } void function2() { char array[ARRAY_SIZE_MAX]; mems原创 2021-04-27 23:27:17 · 117 阅读 · 0 评论 -
[c] c语言实现队列Queue(数组实现、链表实现)
参考:https://blog.csdn.net/song_hui_xiang/article/details/47146503 队列的数组实现 #include <stdio.h> #include <stdlib.h> #define ElementType int //存储数据元素的类型 #define MAXSIZE 6 //存储数据元素的最大个数 #define ERROR -99 //ElementType的特殊值,标志错误 typedef struct {原创 2021-04-27 17:15:22 · 310 阅读 · 0 评论 -
[c] malloc申请动态一维数组、二维数组(矩阵)
参考:https://blog.csdn.net/wzy_1988/article/details/9136373 申请一维数组 #include <stdio.h> #include <stdlib.h> int main(void) { int n, *arr; while (scanf("%d", &n) != EOF) { arr = (int *)malloc(sizeof(int) * n); } return 0; 申请二维数组 #原创 2021-04-27 15:25:02 · 273 阅读 · 0 评论 -
[算法导论] 排序——快排优化(未完待续)
快速排序优化 # C语言版 void quick_sort_v1(int*arr,int l,int r){ if(l>=r) return ; int x=l,y=r,z=arr[l]; while(x<y){ //从右边,大的过,找小的。 while(x<y && arr[y]>=z) --y; //如果符合规则,最小的插入到位。 左边x++ if(x<y) arr[x+原创 2021-04-16 13:10:42 · 66 阅读 · 0 评论 -
[算法导论] 最优分类期望代价 / 最优二叉查找树的期望搜索代价 (未完待续)
《算法导论》第15章 动态规划—最优二叉查找树 https://www.cnblogs.com/Anker/archive/2013/03/13/2958488.html原创 2021-04-11 10:03:31 · 300 阅读 · 0 评论