-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathavltree.h
More file actions
27 lines (23 loc) · 699 Bytes
/
Copy pathavltree.h
File metadata and controls
27 lines (23 loc) · 699 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
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/*
* avltree.h
*
* Written by Paul Vixie
*/
typedef struct tree_s {
struct tree_s *tree_l, *tree_r; /* left & right branches */
char *tree_p; /* data */
short tree_b; /* balance information */
} tree;
void tree_init(tree **);
char *tree_srch(tree *, int (*pfi_compare) (void *, void *), char *);
void tree_add(tree **, int (*pfi_compare) (void *, void *), char *, int (*pfi_action) (void *));
int tree_delete(tree **, int (*pfi_compare) (void *, void *), char *, int (*pfi_action) (void *));
int tree_trav(tree **, int (*pfi_action) (void *));
void tree_mung(tree **, int (*pfi_action) (void *));
#ifdef __cplusplus
}
#endif