#include #include #include using namespace std; typedef struct Tprvek Tprvek; struct Tprvek { int hodnota; Tprvek* dalsi; }; typedef struc { Tprvek* zac; Tprvek* kon; } Tfronta void pridej(Tfornta & f, int hodnota) { Tprvek* pom; pom = new Tprvek; pom->hodnota=hodnota; pom->dalsi=NULL; f.kon->dalsi=pom; f.kon=pom; if (f.zac==NULL) f.zac=pom; } bool odeber(Tfornta & f, int & hodnota) { Tprvek* pom; if (f.zac!=NULL) { pom=f.zac; hodnota=pom->hodnota; if (f.zac==f.kon) f.kon=NULL; f.zac=f.zac->dalsi; delete pom; return true; } else { return false;} }