summaryrefslogtreecommitdiff
path: root/sets.h
diff options
context:
space:
mode:
Diffstat (limited to 'sets.h')
-rw-r--r--sets.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sets.h b/sets.h
index 9465043..ffdf82d 100644
--- a/sets.h
+++ b/sets.h
@@ -25,6 +25,7 @@ struct set_elt {
struct set_elt *next;
};
typedef struct {
+ int N; // range for elements (0 to N-1)
struct set_elt *first, *last;
int size; // number of elements
} t_set_descriptor;
@@ -39,10 +40,13 @@ typedef void* set;
set empty_set(int size);
+set full_set(int size); // set containing all elements from 0 to n-1
set singleton(int size, int x);
set copy_set(const set s);
void delete_set(set a);
+int set_size(const set s);
+
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);