2025-04-19 00:13:46 +08:00
|
|
|
|
#ifndef LINKED_QUEUE_H
|
|
|
|
|
#define LINKED_QUEUE_H
|
|
|
|
|
#define elem_type int
|
|
|
|
|
|
|
|
|
|
typedef struct node
|
|
|
|
|
{
|
|
|
|
|
elem_type value;
|
|
|
|
|
struct node* next;
|
|
|
|
|
} node;
|
|
|
|
|
|
|
|
|
|
typedef struct linked_queue
|
|
|
|
|
{
|
|
|
|
|
struct node* front;
|
|
|
|
|
struct node* rear;
|
|
|
|
|
int size;
|
|
|
|
|
}link_queue;
|
|
|
|
|
|
|
|
|
|
// <20><>ʼ<EFBFBD><CABC>
|
|
|
|
|
link_queue* init_link_queue();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
void push_link_queue(link_queue* q, elem_type value);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
elem_type pop_link_queue(link_queue* q);
|
|
|
|
|
|
|
|
|
|
// <20>п<EFBFBD>
|
|
|
|
|
int empty_link_queue(link_queue* q);
|
|
|
|
|
|
|
|
|
|
// <20><>ӡ
|
|
|
|
|
int print_link_queue(link_queue* q);
|
|
|
|
|
|
|
|
|
|
|
2025-04-29 18:01:09 +08:00
|
|
|
|
#endif
|