-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset.h
More file actions
35 lines (23 loc) · 725 Bytes
/
Copy pathset.h
File metadata and controls
35 lines (23 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __SET_H__
#define __SET_H__
#include <stdbool.h>
#include <stdint.h>
typedef uint32_t Set;
#define SET_CAPACITY 32 // 32 bits means 32 items max.
// Returns an empty set.
Set set_empty(void);
// Returns true if x is in the set, false otherwise.
bool set_member(Set s, int x);
// Returns set s after inserting x.
Set set_insert(Set s, int x);
// Returns set s after removing x.
Set set_remove(Set s, int x);
// Returns the union of set s and set t.
Set set_union(Set s, Set t);
// Returns the intersect of set s and set t.
Set set_intersect(Set s, Set t);
// Returns the difference of set s and set t.
Set set_difference(Set s, Set t);
// Returns the complement of set s.
Set set_complement(Set s);
#endif