This commit is contained in:
2021-03-12 21:43:14 +08:00
parent 0d4f45d43c
commit a2d57b8f96
3 changed files with 128 additions and 0 deletions

23
week3/stack.h Normal file
View File

@@ -0,0 +1,23 @@
#include <stdbool.h>
typedef struct Stack_str {
int size;
int top;
double *data;
} Stack;
bool CreateStack(Stack *stack, int size);
bool IsEmpty(Stack *stack);
bool IsFull(Stack *stack);
bool Top(Stack *stack, double *x);
bool Push(Stack *stack, double x);
bool Pop(Stack *stack, double *x);
void DisplayStack(Stack *stack);
void DestroyStack(Stack *stack);