목록덱 (1)
without haste but without rest
[C / 자료구조] 4주차 실습문제3 - 덱(deque)
#include #include #define MAX_SIZE 5 #define ADD_F 1 #define ADD_R 2 #define REMOVE_F 3 #define REMOVE_R 4 typedef int element; typedef struct { element queue[MAX_SIZE]; int front, rear; } QueueType; void init_queue(QueueType* q){ q->front = q->rear = 0; } void error(char* msg) { fprintf(stderr, "%s\n", msg); exit(1); } int is_empty(QueueType* q) { return q->front == q->rear; } int is_full(Queue..
Homework
2020. 4. 9. 22:48