专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅
假如我们已经知道了要删除的结点p的位置,那么要删除p结点时只要令p结点的前驱结点的链域由存储p结点的地址该为存储p的后继结点的地址,并回收p结点即可。  以下便是应用删除算法的实例:#include <stdio.h>#include <malloc.h>#include <string.h>#define n 10 typedef struct node{ char name[20]; struct node *link;}stud;stud * creat(int n) /*建立新的链表的函数*/{ stud *p,*h,*s; int i; if(( [阅读全文] [PDF]
源代码如下: 参考:[http://www.CrazyCoder.cn/]#include <stdio.h>#include <malloc.h>#include <string.h>#define N 10 typedef struct node{ char name[20]; struct node *link;}stud;stud * creat(int n) /*建立新的链表的函数*/{ stud *p,*h,*s; int i; if((h=(stud *)malloc(sizeof(stud)))==NULL) {  printf(\"不能 [阅读全文] [PDF]
1 共2条 分1页