实现栈类Stack

This commit is contained in:
2024-10-23 20:59:19 +08:00
parent 6fc9ca0e42
commit 935832dbe8
4 changed files with 79 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef STACK_H
#define STACK_H
#define MAX_SIZE 100
typedef struct stack {
int data[MAX_SIZE];
int top;
} stack;
bool isEmpty(stack &s);
bool isFull(stack &s);
void initStack(stack &s);
void push(stack &s, int e);
int pop(stack &s);
#endif //STACK_H