Skip to content
Snippets Groups Projects
Commit a65ec129 authored by Romain Andres's avatar Romain Andres
Browse files

bloqué car je comprends r au hash key

parent fc591658
No related branches found
No related tags found
No related merge requests found
......@@ -18,19 +18,44 @@ typedef struct bst_t {
} bst_t;
bst_t bst_empty(void) {
bst_t t;
t.size = 0;
t.tree = NULL;
return t;
}
int bst_is_empty(bst_t t) {
return t.size == 0;
}
bst_t bst_add(bst_t t, void* x) {
struct node_t* arbre = t.tree;
if (arbre == NULL) {
//Alors on va créer un arbre
struct node_t * newArbre = malloc(sizeof(struct node_t));
newArbre->key = 1; // hash(x) ?
newArbre->val = x;
newArbre->right = NULL;
newArbre->left = NULL;
t.tree = newArbre;
}
else {
//Sinon faut aller a droite ou a gauche jusqua trouver le bon emplacement
while (arbre != NULL) {
if ()
}
}
}
void bst_destroy(bst_t t, void (*free_void)(void*)) {
}
int bst_in(bst_t t, void* x) {
}
unsigned long int bst_size(bst_t t) {
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment