diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | set_bitset.c | 5 | ||||
-rw-r--r-- | set_linked_list.c | 4 | ||||
-rw-r--r-- | sets.h | 71 |
5 files changed, 98 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ce298f8 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ + +exe_ll : mainc.c sets.h set_linked_lists.c + gcc -o exe_ll main.c set_linked_lists.c -DLINKEDLISTS + + +exe_bs : mainc.c sets.h set_bitsets.c + gcc -o exe_bs main.c set_bitsets.c -DBITSETS + +exe_tr : mainc.c sets.h set_treaps.c + gcc -o exe_tr main.c set_treaps.c -DTREAPS + +all : exe_ll exe_bs exe_tr + +clean : + rm exe_ll exe_tr exe_bs + + diff --git a/set_bitset.c b/set_bitset.c new file mode 100644 index 0000000..4be3b4b --- /dev/null +++ b/set_bitset.c @@ -0,0 +1,5 @@ +#include "sets.h" + +struct _set { + + }; diff --git a/set_linked_list.c b/set_linked_list.c new file mode 100644 index 0000000..0121589 --- /dev/null +++ b/set_linked_list.c @@ -0,0 +1,4 @@ +#include "sets.h" + +struct _set { + @@ -0,0 +1,71 @@ +/* + * Projet d'Algorithmique et Programmation + * Alex AUVOLAT, Mendes OULAMARA + * 2013-2014 + * + * Sujet : Algorithme de Bron-Kerbosch pour Maximum-Clique + * (cf maxclique.pdf) + * */ + +#ifndef SET +#define SET +#include <stdbool.h> + +#ifdef BITSETS +struct set{ + int N; + unsigned long long* tab; +}; + +typedef struct set set; +#endif + +#ifdef LINKEDLISTS +struct set_elt { + int value; + struct set_elt *next; +}; +struct set { + set_elt *first, *last; +}; + +typedef struct set *set; +#endif + +#ifdef TREAPS +// TODO +#define main 0 +struct set; +typedef struct set set; +#endif + + +set empty_set(int size); +set singleton(int size, int x); +set copy_set(const set s); +void delete_set(set a); + +void set_union_ip(set a, const set b); +void set_inter_ip(set a, const set b); +void set_diff_ip(set a, const set b); + +set set_union(const set a, const set b); +set set_inter(const set a, const set b); +set set_diff(const set a, const set b); + +bool is_set_empty(const set s); +bool set_mem(int x, const set s); + +int elt_of_set(const set s); + +set set_add(int x, const set s); +void set_add_ip(int x, set s); + +set set_remove(int x, const set s); +void set_remove_ip(int x, set s); + +#endif + + + + |