Return to Snippet

Revision: 53732
at December 2, 2011 07:07 by ikukec


Initial Code
struct osoba {
       int a, x, y;
       };
struct qu {
       osoba el;
       qu *next;
       };
       
struct que 
       {
       qu *front, *rear;
       };
       
que red;


osoba FrontQ (que red) {
      return ((red.front)->next)->el;;
}

void DeQueueQ (que &red) 
{
     qu *brisi=red.front;
     red.front=(red.front)->next;
     delete brisi;
}

void EnQueueQ (osoba x, que &red) {
     qu *novi=new qu;
     novi->el=x;
     novi->next=NULL; 
     (red.rear)->next=novi;
     red.rear=novi;
}

bool IsEmptyQ (que red) {
     if (red.rear==red.front) return true;
     return false;    
}

void InitQ (que &red) {
     qu *novi=new qu;
     novi->next=NULL;
     red.rear=novi;
     red.front=novi;     
}

Initial URL

                                

Initial Description
Zaglavlje.

Initial Title
red_pokazivac.h

Initial Tags

                                

Initial Language
C++