Advertisement
BanyRule

Untitled

Dec 16th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #ifndef FOO_H_
  2. #define FOO_H_
  3.  
  4. struct item;
  5. struct priority_queue;
  6.  
  7. void insert(struct priority_queue *s, int key, int value);
  8. struct item maximum(struct priority_queue *s);
  9. struct item extract_maximum(struct priority_queue *s);
  10. void increase_key(struct priority_queue *s, struct item x, struct item k);
  11.  
  12. #endif
  13.  
  14. #include "priority_queue.h"
  15.  
  16. struct item {
  17. int key;
  18. int value;
  19. };
  20.  
  21. struct priority_queue {
  22. struct item s[100];
  23. };
  24.  
  25.  
  26. void insert(struct priority_queue *s, int key, int value) {
  27.  
  28. }
  29.  
  30. struct item maximum(struct priority_queue *s) {
  31.  
  32. }
  33.  
  34. struct item extract_maximum(struct priority_queue *s) {
  35.  
  36. }
  37.  
  38. void increase_key(struct priority_queue *s, struct item x, struct item k) {
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement