![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
知行千禧
山很高,路很长,学习之路很漫长。
加油!
展开
-
链栈的基本操作(数据结构)
链栈的进栈、出栈、获取栈顶元素、判断栈是否为空操作 typedef struct SNode { int data; struct SNode* next; }SNode,*StackPtr; typedef struct { StackPtr top; }LinkStack; void InitStack(LinkStack& S) { //初始化 S.top = NULL; } bool EmptyStack(LinkStack& S) { //判断栈是否为原创 2021-08-03 20:08:13 · 119 阅读 · 0 评论 -
顺序栈的基本操作(动态、静态存储)(数据结构)
1.动态存储 #define STACK_INIT_SIZE 100 #define STACK_INCREMENT 100 typedef struct { //动态顺序栈 int* top; //栈顶指针 int* base; //栈底指针 int stacksize; }SqStack; 初始化操作 bool InitStack(SqStack& S) { S.base = (int*)malloc(STACK_INIT_SIZE * si原创 2021-07-26 16:36:54 · 722 阅读 · 0 评论 -
单链表的基本操作(严蔚敏版数据结构)
#include <iostream> using namespace std; typedef struct LNode { int data; struct LNode* next; }LNode, * LinkList; //LinkList等价于LNode* //初始化 bool InitList(LinkList& L){ L = (LinkList)malloc(sizeof(LNode)); if (L == NULL) return false; .原创 2021-07-17 19:53:04 · 420 阅读 · 1 评论