数据结构实验4
void basic_action()
{
	SqQueue sq;
	ElemType e;
	printf("初始化队列");
	InitQueue(sq);
	printf("队%s\n",(QueueEmpty(sq)==1?"空":"不空"));
	printf("a 进队\n"); EnQueue(sq,'a');
	printf("b 进队\n"); EnQueue(sq,'b');
	printf("c 进队\n"); EnQueue(sq,'c');
	printf("d 进队\n"); EnQueue(sq,'d');
	printf("队%s\n",(QueueEmpty(sq)==1?"空":"不空"));
	GetHead(sq,e);
	printf("队头元素:%c\n",e);
	printf("出队次序:");
	while(!QueueEmpty(sq))
	{
		//队不空循环
		//出队元素 e
		DeQueue(sq,e);
		printf("%c",e);
	}
	//输出元素 e
	printf("\n 销毁队列\n");
	DestroyQueue(sq);
}
void expand_action(int n, int m)
{
	printf("6 5\n");
	SqQueue sq;
	InitQueue(sq);
	int i;
	for(i = 0; i < n; i++) 
	{
		EnQueue(sq, 'a' + i);
	}
	printf("出列顺序:");
	char p;
	i = 0;
	while(!QueueEmpty(sq))
	{
		DeQueue(sq, p);
		i++;
		if (i%m!=0) {
			EnQueue(sq, p);
		} else 
			{
				printf("%c ", p);
			}
	}
}
int main()
{
	basic_action();
	expand_action(6, 5);
	return 0;
}