辅导:C++技巧(quque
/*@file test.c*/
/*动态增加队列测试程序*/
/*先给队列赋值12个元素,然后在清空队列后给队列赋值20个元素,演示队列的动态增加*/
/* mingw compiled ok */
type
# include " all head . h "
# include " quque . h "
# include " fun . h "
void main()
。
int i,n = 11
element type d;
SqQueue Q;
init queue(& Q);
printf("1。初始化队列并使12个元素入队\ n ");
for(I = 1;I = 1;i - )
{EnQueue(&Q,I);}/*队列中的20个元素*/
QueueTraverse(Q,print);
printf("11。清除队列\ n ");
destroy queue(& Q);
}
0条评论