-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtroisieme.h
57 lines (45 loc) · 1.48 KB
/
troisieme.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "deuxieme.h"
#ifndef EX5
#define EX5
typedef struct cellKey {
Key* data ;
struct cellKey * next ;
} CellKey;
typedef struct cellProtected{
Protected* data;
struct cellProtected* next;
}CellProtected;
typedef struct hashcell {
Key* key;
int val;
} HashCell;
typedef struct hashtable {
HashCell** tab;
int size;
} HashTable;
// liste chainee : cles
void mem_reset(char *buff, size_t n);
CellKey* create_cell_key(Key* key);
void insert_cell_key(CellKey** c, Key* key);
CellKey* read_public_key(char* nomfic);
void print_list_keys(CellKey* c);
void delete_cell_key(CellKey* c);
void delete_list_ck(CellKey* c);
// liste chainee : declarations sigees
CellProtected* create_cell_protected(Protected* pr);
void insert_cell_protected(CellProtected** cp, CellProtected* pr);
CellProtected* read_protected(char* filename);
void print_list_protected(CellProtected* cp);
void delete_cell_protected(CellProtected* cp);
void delete_liste_chainee(CellProtected* cp);
//trouver gagnant de l election
void suppr_non_valide(CellProtected** cp);
//fonctions hashtable
HashCell* create_hashcell(Key* key);
int equal_key(Key * key1, Key * key2);
int hash_function(Key* key, int size);
int find_position(HashTable * t,Key * key);
HashTable* create_hashtable(CellKey* keys, int size);
void delete_hashtable(HashTable* t);
Key *compute_winner(CellProtected *decl, CellKey *candidates, CellKey *voters, int sizeC, int sizeV);
#endif