5.2.1 New

To create an empty queue like this, we do the following:

struct Queue *Queue_new(void)
{
  struct _Queue *pQ;

  pQ = (struct _Queue *)malloc(sizeof(struct _Queue));
  pQ->head = pQ->tail = List_new();
  return ((struct Queue *)pQ);
}



Copyright © 2006-10-23 by Tak Auyeung