c语言
文章平均质量分 73
oywoywoyw
这个作者很懒,什么都没留下…
展开
-
单向链表(非循环)的增、删、查、释放、写入文件
一、单向链表想实现正常的删除都需要获取前一个结点的地址,还不如直接使用双向链表,所以单向链表的应用场景非常少,本例是实现了一个增加和删除数字后仍然能从小到大排序的功能。 二、单向链表的查询效率极低,不像排序后的数组可以使用二分法来加快查询速度,只能从头开始遍历,要想快速查询,只能结合hash来实现了 三、代码如下: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys原创 2021-08-26 15:36:24 · 138 阅读 · 0 评论 -
linux c语言环境 非循环单链表实际应用示例
一、代码: #include <stdio.h> #include <stdlib.h> #define _ULL unsigned long long /*definition of single link:each node can only visit it's next node, and visit it's pre node,the last link point to NULL*/ /*use scene:sort number. get the minnest n原创 2021-08-23 16:49:56 · 126 阅读 · 0 评论