summaryrefslogtreecommitdiff
path: root/sets.h
diff options
context:
space:
mode:
authorMendes Oulamara <oulamara@clipper.ens.fr>2013-11-13 19:19:57 +0100
committerMendes Oulamara <oulamara@clipper.ens.fr>2013-11-13 19:19:57 +0100
commitaba69b8e46b8b1f87bc667b62ae1f60ef42963ab (patch)
tree22a3939b25dedafc9e39c85b46ade9a4f29e264a /sets.h
parente8502faad632842da46f732f359604e5d7a81a81 (diff)
downloadAlgoProg-Projet-aba69b8e46b8b1f87bc667b62ae1f60ef42963ab.tar.gz
AlgoProg-Projet-aba69b8e46b8b1f87bc667b62ae1f60ef42963ab.zip
sets header
Diffstat (limited to 'sets.h')
-rw-r--r--sets.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/sets.h b/sets.h
new file mode 100644
index 0000000..937f867
--- /dev/null
+++ b/sets.h
@@ -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
+
+
+
+