Marko D - red_polje.hr


/ Published in: C++
Save to your folder(s)



Copy this code and paste it in your HTML
  1. struct kli_ban{
  2. char ime_prez[25], vrs_tr;
  3. int god_ro, st_rc;
  4. };
  5.  
  6. struct re{
  7. kli_ban klijent[5000];
  8. int celo, dno;
  9. };
  10.  
  11. typedef struct kli_ban elem;
  12.  
  13. typedef struct re red;
  14.  
  15. int ADDONE (int x){
  16. return ((x+1)%1000);
  17. }
  18.  
  19. bool ISEMPTYQ(re *pok){
  20. if (ADDONE(pok->dno)==pok->celo)return 1;
  21. else return 0;
  22. }
  23.  
  24. elem FRONTQ(re *pok){
  25. return pok->klijent[pok->celo];
  26. }
  27.  
  28. void ENQUEUEQ(elem a, re *pok){
  29. pok->dno=ADDONE(pok->dno);
  30. pok->klijent[pok->dno]=a;
  31. }
  32.  
  33. void DEQUEUEQ(re *pok){
  34. pok->celo=ADDONE(pok->celo);
  35. }
  36.  
  37. void INITQ(re *pok){
  38. pok->dno=4999;
  39. pok->celo=0;}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.