![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法导论-程序
文章平均质量分 71
cpprogrammer
这个作者很懒,什么都没留下…
展开
-
今天写了个链表,好累。
#include #include #include #define TRUE 1 #define FALSE 0 #define EXIT 0 //定义结点 struct nodetype { int data; struct nodetype *next; }; t原创 2011-10-12 18:46:04 · 389 阅读 · 0 评论 -
插入排序法_c实现 (1)
插入元素 从前向后 与循环不变式的元素比较 #include #include #define ARRSIZE 10 int main(void) { int arr[ARRSIZE]={2,6,3,5,4,7,1,0,9,8};原创 2011-10-07 15:16:40 · 610 阅读 · 0 评论 -
插入排序法_c实现 (3)
根据《算法导论》(第二版)中的描叙,对第(2)个程序略加修改,使得每趟的移动在判断后完成,即得到书中的实现: (修改部分为 //......// 中的内容,修改后程序更加简洁) #include #include #define ARRSIZE 10 int m原创 2011-10-14 19:55:12 · 330 阅读 · 0 评论 -
插入排序法_c实现 (2)
插入元素 从后向前 与循环不变式的元素比较 #include #include #define ARRSIZE 10 int main(void) { int arr[ARRSIZE]={2,6,3,5,4,7,1,0,9,8}; i原创 2011-10-14 19:31:55 · 433 阅读 · 0 评论