-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskiplist_sset.c
More file actions
35 lines (25 loc) · 807 Bytes
/
Copy pathskiplist_sset.c
File metadata and controls
35 lines (25 loc) · 807 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
28
29
30
31
32
33
34
35
#include <stdio.h>
#include "skiplist_sset.h"
SKIPLIST_SSET_DECL(int)
void skiplist_sset_test() {
SKIPLIST_SSET(int) s_int;
SKIPLIST_SSET_INIT(int)(&s_int);
for(int i=0; i<40; i++)
SKIPLIST_SSET_ADD(int)(&s_int, i);
for(int i=0; i<40; i++)
printf("%d ", SKIPLIST_SSET_FIND(int)(&s_int, i));
printf("h: %d", s_int.h);
putchar('\n');
for(int i=1; i<40; i+=2)
SKIPLIST_SSET_REMOVE(int)(&s_int, i);
for(int i=0; i<40; i++)
printf("%d ", SKIPLIST_SSET_FIND(int)(&s_int, i));
printf("h: %d", s_int.h);
putchar('\n');
for(int i=0; i<40; i+=2)
SKIPLIST_SSET_REMOVE(int)(&s_int, i);
for(int i=0; i<40; i++)
printf("%d ", SKIPLIST_SSET_FIND(int)(&s_int, i));
printf("h: %d", s_int.h);
printf("\n\n");
}