From cbec036a66960eea2ff1f1cda1f1e07f39461eb9 Mon Sep 17 00:00:00 2001 From: Alex Auvolat--bernstein Date: Wed, 4 Dec 2013 16:49:31 +0100 Subject: Added algorithm C (does not work) --- set_linked_lists.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'set_linked_lists.c') diff --git a/set_linked_lists.c b/set_linked_lists.c index 8cc77c4..ee0a021 100644 --- a/set_linked_lists.c +++ b/set_linked_lists.c @@ -9,6 +9,8 @@ #include #include +#include + #include "sets.h" /* Question théorique pertinente : @@ -92,6 +94,7 @@ set copy_set(const set s) { for (iter = s->first->next; iter != NULL; iter = iter->next) { element e = malloc(sizeof(struct set_elt)); + assert(e != NULL); e->value = iter->value; prev->next = e; prev = e; -- cgit v1.2.3 From 71094b2d48ac784e60d454609064d20e83c017be Mon Sep 17 00:00:00 2001 From: Alex Auvolat--bernstein Date: Wed, 4 Dec 2013 17:26:06 +0100 Subject: Finished implementation for algorithm C, and corrected bitset bugs. --- set_linked_lists.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'set_linked_lists.c') diff --git a/set_linked_lists.c b/set_linked_lists.c index 86a53b3..004e55a 100644 --- a/set_linked_lists.c +++ b/set_linked_lists.c @@ -239,7 +239,10 @@ bool sets_equal(const set a, const set b) { int elt_of_set(const set s) { if (s->first != NULL) return s->first->value; - return -1; // should raise exception... hope this will be handled properly + + fprintf(stderr, "No element in empty set...\n"); + dump_set(s); + assert(false); } int elt_of_set_heur(const set s, int h) { -- cgit v1.2.3