forked from willemt/splay-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
splaytree.h
71 lines (57 loc) · 1.04 KB
/
splaytree.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* =====================================================================================
*
* Filename: splaytree.h
*
* Description:
*
* Version: 1.0
* Created: 07/26/11 22:11:27
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Company:
*
* =====================================================================================
*/
typedef struct
{
void *root;
int (
*cmp
) (
const void *,
const void *
);
int count;
} splaytree_t;
splaytree_t *splaytree_initalloc(
int (*cmp) (const void *,
const void *)
);
void splaytree_free(
splaytree_t * st
);
int splaytree_is_empty(
splaytree_t * st
);
void *splaytree_remove(
splaytree_t * st,
const void *key
);
void *splaytree_get(
splaytree_t * st,
const void *key
);
int splaytree_count(
splaytree_t * st
);
void *splaytree_peek(
splaytree_t * st
);
void splaytree_put(
splaytree_t * st,
void *key,
void *value
);