#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 \ n", myq->base->next->data);
}
int main (int argc, char const *argv[])
{
/* Code */
return 0;
}
Eighth Week Technical Blog published