数据结构
攻城狮Jana
在真正的机会到来之前,请做好两件事:积累知识 和 坚持下去。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[数据结构]——队列的实现(初始化、销毁、入队、出队、获取队头队尾数据、获取队列数据总数、判断队列是否为空)
Queue.h#pragma once#include <stdio.h>#include <assert.h>#include <stdlib.h>typedef int QDataType;typedef struct QListNode //链式结构:表示队列{ QDataType data; struct QueueNode *next;}QueueNode;typedef struct Queue //队列结构{ QueueNod原创 2021-08-12 10:34:42 · 595 阅读 · 0 评论 -
[数据结构]——栈的实现(初始化、销毁、入栈、出栈、记录数据总数、判断栈是否为空、获取栈顶数据)
Stack.h#pragma onece#include <stdio.h>#include <assert.h>typedef int STDataType;typedef struct Stack{ STDataType *a; int top; int capacity;}Stack;void StackInit(Stack *pst); //初始化void StackDestory(Stack *pst); //销毁void StackPush原创 2021-08-10 10:55:06 · 273 阅读 · 0 评论 -
[数据结构]——带有头节点的双向循环链表(创建头节点、创建新节点、头插、尾插、头删、尾删、删除pos位的结点、在pos位前插入结点、查找、销毁)
List.h#pragma once#include <stdio.h>#include <stdlib.h>#include <assert.h>typedef int ListDataType;typedef struct ListNode{ struct ListNode *next; struct ListNode *prev; ListDataType data;}ListNode;ListNode* ListInit(); //创原创 2021-08-09 17:37:32 · 286 阅读 · 0 评论 -
[数据结构]——单链表(动态申请结点、单链表打印、头插、尾插、头删、尾删)
SList.h#pragma once#include <stdio.h>#include <stdlib.h> typedef int SLTDataType;typedef struct SListNode{ SLTDataType data; struct SListNode* next;}SListNode;SListNode* BuySListNode(SLTDataType x); //动态申请结点void SListPrint(SListN原创 2021-08-09 09:18:41 · 243 阅读 · 0 评论 -
[数据结构]——顺序表的实现(初始化、销毁、打印、检查容量、尾插、尾删、头插、头删)
SeqList.h#pragma once#include <stdio.h>#include <stdlib.h>#include <assert.h>#include <string.h> typedef int SLDatatype;typedef struct SeqList{ SLDatatype *a; //指向动态开辟的数组 int size; //有效数据个数 int capacity; //容量空间大小}Seq原创 2021-08-07 11:45:48 · 281 阅读 · 2 评论
分享