随笔分类 - 数据结构篇
摘要:数据结构七 一、二叉树的存储 说明:树的存储分为链式存储和顺序存储两种,然而顺序存储简单,实际中的使用少之又少,因此,这里只使用链式 1.二叉树的链式存储 #include "stdio.h" #include "stdlib.h" typedef char ElemType; struct BiT
阅读全文
摘要:数据结构六 一、关于线性表中栈的顺序存储和链式存储方式的实现方式 1.顺序存储 #include <stdio.h> #define MaxSize 10 //定义队列中元素的最大个数 typedef struct{ int data[MaxSize]; int front,rear;//队头指针和
阅读全文
摘要:数据结构五 一、关于线性表中栈的顺序存储和链式存储方式的实现方式 ###1.栈的顺序存储 #include "stdio.h" #include "stdlib.h" #define MaxSize 10 //定义栈中元素的最大个数 typedef struct { int data[MaxSize
阅读全文
摘要:数据结构四 一、关于线性表中双链表 #include "stdio.h" #include "stdlib.h" struct DNode{ int data; struct DNode* prior,* next; }; struct DNode* CreateNode(int e){ struc
阅读全文
摘要:数据结构三 一、关于线性表中单链表的头插法和尾插法 #include "stdio.h" #include "stdlib.h" struct LNode{ int data; struct LNode* next; }; //创建一个节点 struct LNode* CreateNode(int
阅读全文
摘要:数据结构二 一、关于线性表中单链表的有头单链表实现方式和无头单链表的实现方式 1.无头单链表的实现方式 #include "stdio.h" #include "stdlib.h" struct LNode{ //定义单链表结点类型 int data; //每个节点存放一个数据元素 struct L
阅读全文
摘要:数据结构一 一、关于线性表中顺序表的静态实现方式和动态实现方式 1. 静态实现方式 // 顺序表的实现 静态分配 #include <stdio.h> #define MaxSize 10 typedef struct{ int data[MaxSize]; int length; }SqList;
阅读全文

浙公网安备 33010602011771号