This commit is contained in:
2025-07-12 23:22:19 +08:00
parent 98b0294f80
commit 321cb6c439
3 changed files with 157 additions and 0 deletions

36
include/solution/232.h Normal file
View File

@@ -0,0 +1,36 @@
#ifndef INC_232_H
#define INC_232_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdbool.h>
typedef struct
{
int *base;
int ptr;
int size;
} stack;
typedef struct
{
stack *s1;
stack *s2;
} MyQueue;
MyQueue *myQueueCreate();
void myQueuePush(MyQueue *obj, int x);
int myQueuePop(MyQueue *obj);
int myQueuePeek(MyQueue *obj);
bool myQueueEmpty(MyQueue *obj);
void myQueueFree(MyQueue *obj);
#ifdef __cplusplus
}
#endif
#endif