Advertisement
ChaeYuriya

Assignment 8 : queue_vaksinasi.h

Nov 7th, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #define head(Q) Q.head
  3. #define tail(Q) Q.tail
  4. #define next(S) S->next
  5. #define info(S) S->info
  6.  
  7. using namespace std;
  8.  
  9. struct Infotype {
  10.  string nama;
  11.  int usia;
  12.  string pekerjaan;
  13.  bool prioritas;
  14.  int nomor_antrean;
  15.  int waktu_daftar = 0;
  16.  bool kondisi_darurat;
  17. };
  18.  
  19. struct ElemQ{
  20.  Infotype info;
  21.  ElemQ *next;
  22. };
  23.  
  24. struct Queue {
  25.  ElemQ *head;
  26.  ElemQ *tail;
  27. };
  28.  
  29.  
  30. void createQueue(Queue &Q);
  31. bool isEmpty(Queue Q);
  32. ElemQ* createElemQueue(string nama, int usia, string pekerjaan, int nomor_antrean);
  33. void enqueue(Queue &Q, ElemQ *P);
  34. void dequeue(Queue &Q, ElemQ *&P);
  35. ElemQ* front(Queue Q);
  36. ElemQ* back(Queue Q);
  37. int size(Queue Q);
  38. void printInfo(Queue Q);
  39. void serveQueue(Queue *Q);
  40. void reassignQueue(Queue &Q);
  41. void checkWaitingTime(Queue &Q,int waktu_sekarang);
  42. void emergencyHandle(Queue &Q,int nomor_antrean);
  43. void updatePriority(Queue &Q);
  44. ElemQ* findAndRemove(Queue &Q, int nomor_antrean);
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement