数据结构/算法
文章平均质量分 76
zrr2743649200
越努力越幸运
展开
-
创建带表头结点的单向链表,并实现各种功能
程序:#include #include struct node{int num;char name[20];struct node * next;};typedef struct node Node;typedef struct node * Link; //重命名;void is_malloc_ok(Link new原创 2017-02-10 15:21:03 · 2645 阅读 · 0 评论 -
创建不带表头结点的单向链表,并实现各种功能
程序:#include #include struct node{int num;char name[20];struct node * next;};typedef struct node Node;typedef struct node * Link;原创 2017-02-09 19:32:56 · 2213 阅读 · 0 评论 -
C语言分别实现冒泡排序、快速排序、选择排序
冒泡排序:#include #define N 5int main(){ int a[N] = {2,3,1,5,4}; int i,j; int tmp; for(i = 0;i {for(j = 0;j { if(a[j]>a[j+1]) {tmp = a[j+1];a[j+1] = a原创 2017-09-27 19:36:37 · 653 阅读 · 0 评论