-
Notifications
You must be signed in to change notification settings - Fork 0
/
abb.h
32 lines (24 loc) · 1 KB
/
abb.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
#ifndef ABB_ABB_H
#define ABB_ABB_H
#include <stdbool.h>
#include <stdlib.h>
typedef int (*abb_comparar_clave_t) (const char *, const char *);
typedef void (*abb_destruir_dato_t) (void *);
// Arbol Binario
typedef struct abb abb_t;
abb_t* abb_crear(abb_comparar_clave_t cmp, abb_destruir_dato_t destruir_dato);
bool abb_guardar(abb_t *arbol, const char *clave, void *dato);
void *abb_borrar(abb_t *arbol, const char *clave);
void *abb_obtener(const abb_t *arbol, const char *clave);
bool abb_pertenece(const abb_t *arbol, const char *clave);
size_t abb_cantidad(const abb_t *arbol);
void abb_destruir(abb_t *arbol);
void abb_in_order(abb_t *arbol, bool visitar(const char *, void *, void *), void *extra);
// Iter
typedef struct abb_iter abb_iter_t;
abb_iter_t *abb_iter_in_crear(const abb_t *arbol);
bool abb_iter_in_avanzar(abb_iter_t *iter);
const char *abb_iter_in_ver_actual(const abb_iter_t *iter);
bool abb_iter_in_al_final(const abb_iter_t *iter);
void abb_iter_in_destruir(abb_iter_t* iter);
#endif //ABB_ABB_H