亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        輔導:C++技巧(quque-c動態(tài)變長隊列)

        字號:

        /*@file test.c*/
            /*動態(tài)增大隊列測試程序*/
            /*先分配12個元素,清除隊列后,再分配20個元素入隊列,演示隊列動態(tài)增大*/
            /*mingGW compiled ok*/
            typedef int ElemType;
            #include "allhead.h"
            #include "quque.h"
            #include "fun.h"
            void main()
            {
            Status j;
            int i,n=11;
            ElemType d;
            SqQueue Q;
            InitQueue(&Q);
            printf("1.初始化隊列,12個元素入隊\n");
            for(i=1;i<=12;i++)
            {EnQueue(&Q,i);}/*12個元素入隊*/
            printf("2.隊列空否?%u(1:空 0:否)\n",QueueEmpty(Q));
            printf("3.隊列長度?%d\n",QueueLength(Q));
            printf("4.隊列元素為: ");
            QueueTraverse(Q,print);
            printf("5.刪除隊頭元素");
            DeQueue(&Q,&d); printf("%d",d);
            printf("\n6.隊列元素為: ");
            QueueTraverse(Q,print);
            j=GetHead(Q,&d);
            if(j)
            printf("7.隊頭元素為: %d\n",d);
            else
            printf("7.無隊頭元素(空隊列)\n");
            ClearQueue(&Q);
            printf("8.清空隊列后, 隊列空否?%u(1:空 0:否)\n",QueueEmpty(Q));
            printf("9.清除隊列\(zhòng)n");
            DestroyQueue(&Q);
            printf("10.20個元素入隊\n");
            for(i=20;i>=1;i--)
            {EnQueue(&Q,i);}/*20個元素入隊*/
            QueueTraverse(Q,print);
            printf("11.清除隊列\(zhòng)n");
            DestroyQueue(&Q);
            }