这个题只需注意这是单向且不循环的链式队列,不是我们脑补的front = rear = head 链表为空的循环队列!
tmp=(QueueType *)malloc(sizeof(QueueType)); tmp->next = NULL; tmp->Data = Data; rear->next = tmp; rear = tmp;
front == NULL;
rear->Data = Data; tmp=(QueueType *)malloc(sizeof(QueueType)); tmp->next = NULL; rear->next = tmp; rear = tmp;
front + 1= rear + 1= t1;
front不变,rear + 1 = t2;
front = rear = null;
front = rear = ti;
front = head,rear + 1= t1;
front = head,rear + 1 = t2;
front = rear 即可;
front = ti,front != rear;