Return to Snippet

Revision: 54166
at December 13, 2011 17:38 by boki567


Initial Code
struct pacijent {
       int prior, x, y;
       };
struct qu {
       pacijent el;
       qu *next;
       };
struct que {
       qu *front, *rear;
       };
que red;
 
pacijent FrontQ (que red_atp) {
      return ((red_atp.front)->next)->el;;
}
void EnQueueQ (pacijent pac, que &red_atp) {
     qu *novi=new qu;
     novi->el=pac;
     novi->next=NULL; 
     (red_atp.rear)->next=novi;
     red_atp.rear=novi;
}
void DeQueueQ (que &red_atp) {
     qu *brisi=red_atp.front;
     red_atp.front=(red_atp.front)->next;
     delete brisi;
}
bool IsEmptyQ (que red_atp) {
     if (red_atp.rear==red_atp.front) return true;
     return false;    
}
void InitQ (que &red_atp) {
     qu *novi=new qu;
     novi->next=NULL;
     red.rear=novi;
     red.front=novi;     
}

Initial URL


Initial Description
biblioteka pokazivaci_red.h

Initial Title
pokazivaci_red.h

Initial Tags


Initial Language
C++