![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
我真蚌!
Stay hungry
展开
-
数据结构——顺序表
顺序存储的线性表(顺序表) a.初始化 b.插入节点 c.遍历 优点:访问随机 缺点:需要大片连续内存,插入删除需要挪动元素,效率低 代码实现: typedef struct ARRAY //用于管理顺序表的数据类型 { int * parr;//顺表的起始地址 int len;//表示能够存储的数据节点的个数 int cnt;//已经使用了的表项...原创 2018-10-24 10:11:49 · 138 阅读 · 0 评论 -
数据结构——单向循环链表
代码实现 typedef struct node { int data;//数据域 struct node *next; }NODE,*PNODE; PNODE init_link_list(void)//单链表初始化 { PNODE phead = malloc(sizeof(NODE)); if(phead == NULL) { e...原创 2018-10-24 14:00:55 · 184 阅读 · 0 评论 -
数据结构——双向循环链表
代码实现 typedef struct node { int data;//数据域 struct node *next; struct node *prev; }NODE,*PNODE; PNODE init_dc_list(void)//双向循环链表的初始化 { PNODE phead = malloc(sizeof(NODE)); if...原创 2018-10-24 14:06:50 · 171 阅读 · 0 评论 -
数据结构——栈
一、顺序栈 代码实现: #include <stdio.h> #include <unistd.h> #include <errno.h> #include <strings.h> #include <string.h> #include <stdbool.h> #include <stdlib.h> yp原创 2018-10-24 20:39:20 · 78 阅读 · 0 评论