数据结构
自己整理的数据结构相关知识
Battle_Cry#
这个作者很懒,什么都没留下…
展开
-
数据结构——线性表(王道顺序表动态分配的顺序表增加空间)
#include <stdio.h>#include <stdlib.h>#define Initsize 10#define Elemtype inttypedef struct{ Elemtype *data; int Maxsize; int length;}Seqlist;void InitLiner(Seqlist *list){ //初始化函数 list->data = (Elemtype *)malloc(Initsize *sizeof原创 2021-07-02 22:25:32 · 562 阅读 · 3 评论 -
数据结构——线性表(王道顺序表的顺序存储)
王道数据结构的代码,手打熟悉,顺便复习下c的操作,用python用的全忘了包含了静态分配的创建、插入、删除、查找4个操作#include <stdio.h>#include <stdlib.h>#define Elemtype int#define MaxSize 10//静态分配的顺序表的定义typedef struct{ Elemtype data[MaxSize]; int length;}Sqlist;void InitLiner(Sqlist *l原创 2021-07-02 21:50:06 · 167 阅读 · 0 评论 -
数据结构——线性表的链式存储
线性表顺序存储常用操作结构体的定义结构体的定义#include <stdio.h>#include <stdlib.h>typedef int ElemType ;typedef struct LNode{ //声明结点的类型和指向结点的指针类型 ElemType data; //数据元素的类型 struct LNode *nex...原创 2020-01-20 23:04:28 · 154 阅读 · 0 评论 -
数据结构——线性表顺序结构存储总结
定义线性表结构体(空间分配,静态:数组;动态:指针)#include <stdio.h>#include <stdlib.h>#define LIST_INIT_SIZE 100 //线性表存储空间的初始分配量 #define LISTINCREMENT 10 //线性表存储空间的分配增量 typedef int ElemType ;typedef st...原创 2020-01-20 12:56:07 · 267 阅读 · 0 评论