![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
存储方式
浅唱随风飞
这个作者很懒,什么都没留下…
展开
-
链式存储(链表)
有头单向链表 #include<stdio.h> #include<stdlib.h> typedef struct node { int data; struct node* next; }link_node_t; /* 创建空单向链表 */ link_node_t* createEmptynode () { link_node_t* p = malloc(sizeof(link_node_t)); if(p == NULL) { printf("goto ba原创 2022-04-06 22:12:15 · 945 阅读 · 0 评论 -
顺序存储(顺序表)
#include<stdio.h> #include<stdlib.h> #define N 100 typedef struct { int a[N]; int last; }seqlist_t; /* 创建新表 */ seqlist_t* creatnewseqlist () { seqlist_t* p = malloc(sizeof(seqlist_t)); //在堆区创建一个结构体返回首地址 if(p == NULL) { printf("goto.原创 2022-04-06 20:42:27 · 67 阅读 · 0 评论 -
顺序栈存储
#include<stdio.h> #include<stdlib.h> #define N 50 typedef struct { int a[N]; int top; }seqstack_t; /*创建空顺序栈*/ seqstack_t* creatEmpty () { seqstack_t* p = malloc(sizeof(seqstack_t)); if (p == NULL) { return NULL; } p->top = 0; re.原创 2022-04-09 23:43:55 · 53 阅读 · 0 评论