Advertisement
Guest User

Set.h

a guest
Aug 7th, 2010
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #ifndef SET_H__
  2. #define SET_H__
  3.  
  4. typedef enum boolean {FALSE, TRUE} Boolean;
  5.  
  6. typedef int SetEntry;
  7.  
  8. typedef struct set {
  9.    SetEntry data;
  10.    set* next;
  11.    int size;
  12. };
  13. typedef struct set Set;
  14.  
  15. void Set_Create (Set* set);
  16. void Set_Clear    (Set* set);
  17. int Set_Size      (const Set* set);
  18. Boolean Set_Empty  (const Set* set);
  19.  
  20. Boolean Set_Insert (Set* set, SetEntry value);
  21. Boolean Set_Delete (Set* set, SetEntry value);
  22. Boolean Set_Contains (const Set* set, SetEntry value);
  23.  
  24. void Set_Union  (const Set* set1, const Set* set2, Set* ret);
  25. void Set_Intersection  (const Set* set1, const Set* set2, Set* ret);
  26.  
  27. double Set_Similarity (const Set* set1, const Set* set2);
  28. void Set_Print (const Set* set);
  29.  
  30. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement