随笔分类 - 数据结构与算法
摘要:时间优先的方式实现数据的压缩、解压缩 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <string.h> // "aaaaabbbhaihualovefangfangooooooooo"
阅读全文
摘要:硬盘检索 将硬盘中的文件逐行读入内存进行检索,速度慢 #define _CRT_SECURE_NO_WARNINGS #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> char path[256]
阅读全文
摘要:数据结构中的栈——先进后出,先进先出 数据结构中的堆——堆的本质是一个二叉树,包括二分法查找,朗格朗日差值查找,堆排序查找极值 结构体 void main006() { struct myStruct // 结构体的意义:将多种类型的数据整合在一起 { int a[10]; int i; }; st
阅读全文
摘要:时间种子的随机数的生成,需要#include <time.h>。 #include <time.h> time_t ts; unsigned int num = time(&ts); srand(num); // 或者 srand((unsigned int)(time(NULL))); 时间变化的
阅读全文
摘要:0001、选择排序法 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #define N 20 5 6 7 void main() 8 { 9 time_t ts; 10 srand((unsigned int)tim
阅读全文
摘要:001、斐波那契数列 /* 斐波那契数列:f(n)=f(n-1)+f(n-2);其中f(1)=f(2)=1;*/ #include <stdio.h> #include <stdlib.h> /* 斐波那契数列:f(n)=f(n-1)+f(n-2);其中f(1)=f(2)=1; */ int Fib
阅读全文
浙公网安备 33010602011771号