Files
dsa/week3/stack.h
2021-03-12 21:43:14 +08:00

24 lines
370 B
C

#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);