上一页 1 2 3 4 5 6 7 ··· 9 下一页

2018年2月14日

循环链表范例(约瑟夫问题) 数组实现

摘要: #include#include#include #define CALLOC(P, N, S)\ if(!((P)=calloc(N, S))){\ printf( stderr, "Insufficient memory");\ exit(EXIT_FAILUR... 阅读全文

posted @ 2018-02-14 11:00 MACHINE_001 阅读(109) 评论(0) 推荐(0) 编辑

2018年2月3日

循环链表范例(约瑟夫问题)指针实现

摘要: #include#include#includetypedef struct node* link; //链接struct node{ int item; link next; };//节点int main(void){ int N,M; printf("输入人... 阅读全文

posted @ 2018-02-03 10:26 MACHINE_001 阅读(154) 评论(0) 推荐(0) 编辑

2018年2月1日

抛硬币的模拟

摘要: #include#include#define CALLOC(P, N, S)\ if(!((P)=calloc(N, S))){\ printf( stderr, "Insufficient memory");\ exit(EXIT_FAILURE);\ }in... 阅读全文

posted @ 2018-02-01 14:07 MACHINE_001 阅读(268) 评论(0) 推荐(0) 编辑

埃拉托色尼筛算法查找素数(动态内存实现)

摘要: #include#include#define CALLOC(P, N, S)\ if(!((P)=calloc(N, S))){\ printf( stderr, "Insufficient memory");\ exit(EXIT_FAILURE);\ } ... 阅读全文

posted @ 2018-02-01 12:20 MACHINE_001 阅读(83) 评论(0) 推荐(0) 编辑

2018年1月26日

静态栈抽象数据类型stack实现

摘要: #include#include#include#define MAX_STACK_SIZE 10 //堆栈的最大大小typedef struct{ int key; //其他内容}Element;//模板类型void push( Element item, Elem... 阅读全文

posted @ 2018-01-26 21:55 MACHINE_001 阅读(121) 评论(0) 推荐(0) 编辑

2018年1月9日

多项式_计算 动态内存存储

摘要: #include#include#include#include#define CALLOC(P, N, S)\ if(!((P)=calloc(N, S))){\ printf( stderr, "Insufficient memory");\ exit(EXIT... 阅读全文

posted @ 2018-01-09 16:01 MACHINE_001 阅读(84) 评论(0) 推荐(0) 编辑

2018年1月3日

矩阵转置 动态内存实现

摘要: #include#include#define SWAP(X,Y,TEMP) ((TEMP)=(X),(X)=(Y),(Y)=(TEMP))#define MAX_SIZE 3#define CALLOC(P, N, S)\ if(!((P)=calloc(N, S... 阅读全文

posted @ 2018-01-03 09:53 MACHINE_001 阅读(109) 评论(0) 推荐(0) 编辑

2018年1月1日

矩阵加法 时间性能测量

摘要: #include #include #define MAX_SIZE 100typedef struct { long repetitions; double duration;}times;void timer(void (*add)( int a[][MAX_SI... 阅读全文

posted @ 2018-01-01 17:10 MACHINE_001 阅读(78) 评论(0) 推荐(0) 编辑

折半排序 循环&递归 时间性能测试

摘要: #include #include #define COMPARE(x, y) (((x) repetitions=0; clock_t start=clock(); do{ x->repetitions++; binsearch(list, searchnum,... 阅读全文

posted @ 2018-01-01 15:36 MACHINE_001 阅读(127) 评论(0) 推荐(0) 编辑

2017年12月31日

数组求和(递归和循环)函数 时间性能测量(最差情形)

摘要: #include #include #define MAX_SIZE 1000typedef struct { double duration; long repetitions;}times;double sum_f(double list[], int n);do... 阅读全文

posted @ 2017-12-31 22:12 MACHINE_001 阅读(129) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 9 下一页

导航