#include <iostream>
#include <stdio.h>
#include <string.h>
#include <conio.h>
using namespace Std;
typedef struct student{
int data;
struct student *next;
}node;
typedef struct LINKQUEUE
{
Node *first, *rear;
}queue;
Queue Queued
Queue *insert (queue *hq, int x)
{
Node *s;
s = (node*) malloc (sizeof (node));
S->data = x;
S->next = NULL;
if (hq->rear = = NULL)
{
Hq->first = s;
Hq->rear = s;
}
Else
{
Hq->rear->next = s;
Hq->rear = s;
}
}
Queue out Team
Queue *del (Queue *HQ)
{
Node *p;
int x;
if (Hq->first = = NULL)
{
printf ("\ n Yichu");
}
Else
{
x = hq->first->data;
p = hq->first;
if (Hq->first = = hq->rear)
{
Hq->first = NULL;
Hq->rear = NULL;
}
Else
{
Hq->first = hq->first->next;
Free (p);
}
return (HQ);
}
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Queued and out-of-band operations