数据结构
Trisection-white
寻找属于你我的世界。
展开
-
数据结构-两栈空间顺序栈表示
#include <stdio.h> #include <stdlib.h> //两栈共享 //两个栈空间在一个数组里 //栈1头=-1,栈2头 = MAX_SIZE const int MAX_SIZE = 10; typedef int DataType; typedef struct { DataType data[MAX_SIZE]; int top1; int top2; }BothStack; void Initial(BothStack* bs); void原创 2021-10-21 23:40:05 · 97 阅读 · 0 评论 -
数据结构-顺序栈
#include <stdio.h> #include <stdlib.h> //顺序栈,用数组 //数组的话没有链表那么花里胡哨 //初始化、入栈、出栈、遍历 #define MAX_SIZE 10 typedef int DataType; typedef struct { DataType data[MAX_SIZE]; int top; } SeqStack; void Initial(SeqStack* s); void push(SeqStack* s原创 2021-10-21 23:38:08 · 141 阅读 · 0 评论