Advertisement
Ruggeri96

Untitled

Jan 22nd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. // PQ.h
  2. #ifndef PQ_H_INCLUDED
  3. #define PQ_H_INCLUDED
  4.  
  5. // Scelta tra Quasi ADT per le code a priorità o Item adhoc
  6. #include "Item.h"
  7.  
  8. typedef struct pqueue *PQ;
  9.  
  10. PQ PQinit(int maxN);
  11. void PQfree(PQ pq);
  12. int PQempty(PQ pq);
  13. void PQinsert(PQ pq, Item val);
  14. Item PQextractMax(PQ pq);
  15. Item PQshowMax(PQ pq);
  16. void PQdisplay(PQ pq);
  17. int PQsize(PQ pq);
  18. void PQchange(PQ pq, Item val);
  19.  
  20.  
  21.  
  22.  
  23. #endif // PQ_H_INCLUDED
  24.  
  25. // Item.h
  26. // Quasi ADT Item per le code a priorità
  27. #ifndef ITEM_H_INCLUDED
  28. #define ITEM_H_INCLUDED
  29.  
  30. #include "Constants.h"
  31.  
  32. typedef struct {
  33.     char name[MAX_C+1];
  34.     int prio;
  35.  
  36. } Item;
  37.  
  38. typedef char* Name;
  39.  
  40. Item ITEMscan();
  41. void ITEMshow(Item val);
  42. Item ITEMsetNull();
  43. int ITEMcheckNull(Item val);
  44.  
  45. Name NAMEget(Item* pval);
  46. int NAMEcmp(Name n1, Name n2);
  47. int PRIOget(Item val);
  48.  
  49.  
  50.  
  51.  
  52. #endif // ITEM_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement