???????
????????????????????У?????Linux??????/????????????????????????????????????????????漰????????л??????£?

?????????????????????????????????
?????  ???????????
????1.1 ?????????ж???
???????????????????????????????????????????β????(???)??????????(????)??????????????μ??β????????????????????????????
???????е????洢??????????????????????????????????£?
????1 struct Queue{
????2     ElemType elem[MaxSize];
????3     int head?? tail;
????4 };
??????????????elem???洢?????е????????????????????head??tail???洢?????????β(???β?????)?????±?λ?????????????????β???MaxSize??????洢???е????????????ж?????洢???????????????е????洢??侲????????MaxSize???????壻????????????????????????????
?????????????д???“?????”???????????????????????????????λ?????β??????????к???????λ???????????μ??????????????????????????????β????????????????????????????????????????????????????й??????????????β?????????????????е??MaxSize-1??λ?????ú?????????п?????????μ?????????????е?0??λ?á?????????????????????????????н???
???????????MaxSize=4??????????????????

???????У????????????????????????????????(????±??3??λ??)????????????????head????????????β???tail????β????????????????β????1???????????ж??????????
???????????head = tail = 0??
???????п??head == tail??
????????????(tail + 1) % MaxSize == head??
???????????num = (tail - head + MaxSize) % MaxSize
????%???????????????????????????????????β??????????
?????????head??????????????tail????β????????????????????????????????head??????????tail????β?????????????(tail - head + 1 + MaxSize) % MaxSize??
??????????????????????????????????????????????????????λ????????????????????
??????????????λ?ú??????????????????????β???????λ?á?????????????????????????β???(????????)???????????????
???????п??num == 0??
????????????num == MaxSize??
??????βλ???tail = (head + num + MaxSize) % MaxSize
????1.2 ?????????????
?????????????C??????????????????????????????????????
?????????????????н????£?
????1 #define QUEUE_SIZE   5 //???д?????QUEUE_SIZE-1?????
????2 typedef struct{
????3     int aData[QUEUE_SIZE];  //???????
????4     int dwHead;  //?????????
????5     int dwTail;  //????β????????????
????6 }T_QUEUE?? *PT_QUEUE;
??????????????????????????