没有合适的资源?快使用搜索试试~ 我知道了~
首页关于c语言链表的学习总结
资源详情
资源评论
资源推荐

关于关于c语言链表的学习总结语言链表的学习总结
我这些天在学习数据结构,发现了一些问题。闲话少叙,先上代码(参考教材:数据结构-c语言,耿国华编著,
有删改)。
#include
typedef struct node//结构体,单链表
{
char data;
struct node * next;
}node,* linklist;
int countfromtail(linklist l)//记录长度
{
p = l->next;
node *p;
int count = 0;
while (p!= NULL)
{
p= p->next;
count++;
}
return count;
}
node * findlinklist(linklist l, char q)//按值查找
{
node *r;
r = l->next;
while (l->next != NULL)
{
if (r->data != q)
{
r = r->next;
}
else
break;
}
return r;
}

















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0