-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathpcu_aa.h
34 lines (25 loc) · 1.05 KB
/
pcu_aa.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
/******************************************************************************
Copyright 2011 Scientific Computation Research Center,
Rensselaer Polytechnic Institute. All rights reserved.
This work is open source software, licensed under the terms of the
BSD license as described in the LICENSE file in the top-level directory.
*******************************************************************************/
#ifndef PCU_AA_H
#define PCU_AA_H
#include <stdbool.h>
typedef struct pcu_aa_node_struct* pcu_aa_tree;
struct pcu_aa_node_struct
{
pcu_aa_tree left;
pcu_aa_tree right;
int level;
};
typedef struct pcu_aa_node_struct pcu_aa_node;
typedef bool pcu_aa_less(pcu_aa_node* a, pcu_aa_node* b);
void pcu_make_aa(pcu_aa_tree* t);
bool pcu_aa_empty(pcu_aa_tree t);
pcu_aa_node* pcu_aa_insert(pcu_aa_node* x, pcu_aa_tree* t, pcu_aa_less* less);
pcu_aa_node* pcu_aa_remove(pcu_aa_node* x, pcu_aa_tree* t, pcu_aa_less* less);
pcu_aa_node* pcu_aa_find(pcu_aa_node* x, pcu_aa_tree t, pcu_aa_less* less);
int pcu_aa_count(pcu_aa_tree t);
#endif