#include #include #include #include "set.h" #include "hash_table.h" struct set { HashTable ht; }; Set SetNew(void) { Set s = malloc(sizeof(*s)); s->ht = HashTableNew(); return s; } void SetFree(Set s) { HashTableFree(s->ht); free(s); } void SetInsert(Set s, int item) { HashTableInsert(s->ht, item, 1); // value doesn't matter } bool SetContains(Set s, int item) { return HashTableContains(s->ht, item); } void SetDelete(Set s, int item) { HashTableDelete(s->ht, item); } int SetSize(Set s) { return HashTableSize(s->ht); } void SetShow(Set s) { HashTableShow(s->ht); }