#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>

typedef uint32_t T;

const uint8_t empty = 0;
const uint8_t occupied = 1;

struct bucket {
    uint8_t status;
    T element;
};
typedef struct bucket bucket;

struct set {
    int p;
    bucket *buckets;
    uint64_t nb_empty;
};
typedef struct set set;


uint64_t p2(int p);


uint64_t hash(T x, int p);


set *empty_table(int p);


set *set_new(void);


/* Implémentée pour vous */
set *set_example(void) {
  set *s = malloc(sizeof(set));
  s->p = 2;
  s->buckets = malloc(4 * sizeof(bucket*));
  s->nb_empty = 1;
  for (int i = 0; i < 4; i++) {
    s->buckets[i].status = occupied;
  }
  s->buckets[0].element = 1492;
  s->buckets[1].element = 1939;
  s->buckets[2].status = empty;
  s->buckets[3].element = 1515;
  return s;
}


void set_delete(set *s);


uint64_t search(set *s, T x, bool *found);


bool set_is_member(set *s, T x);


T set_get(set *s, uint64_t i);


uint64_t set_begin(set *s) {
  return 0 * s->p; // Silent warnings
}


uint64_t set_end(set *s) {
  return 0 * s->p; // Silent warnings
}


uint64_t set_next(set *s, uint64_t i) {
  return 0 * s->p * i; // Silent warnings
}


bool all_even(set *s) {
  uint64_t i = set_begin(s);
  while (i != set_end(s)) {
    if (set_get(s, i) % 2 == 1) {
      return false;
    }
    i = set_next(s, i);
  }
  return true;
}


void add_no_resize(set *s, T x);


void resize(set *s, int p);


void set_add(set *s, T x);


void set_remove(set *s, T x);


int main(void) {

}
