数据结构 - 栈 栈 数据结构 #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <assert.h> // 栈可以用数组或链表来存取数据,数组更优,因此这里用数组实现 typedef int SDataType; typedef struct Stack { SDataType *arr; int top; // 栈顶 int capacity; // 容量 } Stack; zedo2022/8/10大约 1 分钟数据结构线性表栈C语言