연결된큐


연결된큐

#include #include #define MAX_QUEUE_SIZE 100 typedef struct LinkedNode { int data; struct LinkedNode* link; } Node; Node* front = NULL; Node* rear = NULL; void init_queue() { front = rear = NULL; } int is_empty() { return front == NULL; } int size() { Node* p; int count = 0; for (p = front; p != NULL; p = p->link) count++; return count; } void enqueue(int val) { Node* p = (Node*)malloc(sizeof(No..


원문링크 : 연결된큐