Revision: 39282
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 16, 2011 02:57 by dario123
Initial Code
struct tosoba {
char imeiprezime[35];
char transakcija[35];
int stanje;
int godiste;
};
typedef tosoba elementtype;
struct trow{
elementtype elements[1000];
int pocetak,kraj;
};
typedef trow red;
int AddOne(int n) {
return((n+1)%10000);
}
void InitQ(red *Q){
Q=new red;
Q->pocetak=0;
Q->kraj=9999;
return Q;
}
elementtype FrontQ(red *Q){
if(IsEmptyQ(Q)==1) return 0;
else {
return Q->elements[Q-pocetak];
}
}
void EnQueueQ(elementtype x, red *Q){
if(IsEmptyQ(Q)==1) return;
else {
Q->kraj=AddOne(Q->kraj);
Q->elements[Q->kraj]=x;
}
}
void DeQueueQ(red *Q){
if(IsEmptyQ(Q)==1) return;
Q->pocetak=AddOne(Q->pocetak);
}
bool IsEmptyQ(red *Q){
if(AddOne(Q->pocetak)==Q->kraj) return 1;
else return 0;
}
Initial URL
Initial Description
Initial Title
implementacija_cirkulano polje_db
Initial Tags
Initial Language
C++