单链表创建以及头插、尾插(二)-(B站)史上最强最细腻的linux嵌入式C语言学习教程【李慧芹老师】

C语言高级进阶

链表是由一系列互相连接的节点组成的数据结构,这种数据结构非常有用,是实现队列和栈的基础。

学习内容

这一章我们继续单链表的学习,实现一个无头单链表的创建,插入,按值查找,显示以及销毁。代码来自于(B站)史上最强最细腻的linux嵌入式C语言学习教程【李慧芹老师】,需要学习的童鞋自行搜索观看,此处不多介绍。

学习产出

nohead.h

#ifndef __NOHEAD_H__
#define __NOHEAD_H__

#define NAMESIZE 32

struct score_st
{
   
    int id;
    char name[NAMESIZE];
    int math;
    int chinese;
};

struct node_st
{
   
    struct score_st data;
    struct node_st *next;
};

int list_insert(struct node_st **list,struct score_st *data);

void list_show(struct node_st*);


int list_delete(struct node_st **);

struct score_st * list_find(struct node_st *, int id);

void list_distroy(struct node_st *);


#endif 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值