/ Published in: C++
Zaglavlje za program.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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; }