#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
typedef int DataType;
typedef struct Space
{
DataType data;
Space* next;
}Space;
typedef struct Queue
{
Space* base;
Space* top;
int length;
}Queue;
Queue* initQ()
{
Queue *myQ;
myQ=(Queue *)malloc(sizeof(Queue));
myQ->length;
myQ->base=(Space *)malloc(sizeof(Space));
myQ->base->next=NULL;
myQ->top=myQ->base;
return myQ;
}
void insQ(Queue* myQ, DataType data)
{
Space *temp=(Space *)malloc(sizeof(Space));
temp->next=NULL;
temp->data=data;
myQ->top->next=temp;
myQ->top->next=myQ->top->next->next;
myQ->length++;
}
void remQ(Queue* myQ)
{
if(myQ->length==0)
printf("the queue is empty");
Space* temp=myQ->base->next;
myQ->base->next=myQ->base->next->next;
free(temp);
myQ->length--;
}
void getTop(Queue* myQ)
{
printf("%d
",myQ->base->next->data );
}
int main(int argc, char const *argv[])
{
/* code */
return 0;
}