acl
3.5.3.0
|
#include "acl_define.h"
类型定义 | |
typedef struct ACL_BTREE | ACL_BTREE |
函数 | |
ACL_API ACL_BTREE * | acl_btree_create (void) |
ACL_API int | acl_btree_destroy (ACL_BTREE *tree) |
ACL_API void * | acl_btree_find (ACL_BTREE *tree, unsigned int key) |
ACL_API int | acl_btree_add (ACL_BTREE *tree, unsigned int key, void *data) |
ACL_API void * | acl_btree_remove (ACL_BTREE *tree, unsigned int key) |
ACL_API int | acl_btree_get_min_key (ACL_BTREE *tree, unsigned int *key) |
ACL_API int | acl_btree_get_max_key (ACL_BTREE *tree, unsigned int *key) |
ACL_API int | acl_btree_get_next_key (ACL_BTREE *tree, unsigned int cur_key, unsigned int *next_key) |
ACL_API int | acl_btree_depth (ACL_BTREE *tree) |
ACL_API void | acl_btree_dump (ACL_BTREE *b) |
二叉树结构类型定义
在文件 acl_btree.h 第 13 行定义.
ACL_API int acl_btree_add | ( | ACL_BTREE * | tree, |
unsigned int | key, | ||
void * | data | ||
) |
向二叉树中添加
tree | {ACL_BTREE*} 二叉树对象 |
key | {unsigned int} 键 |
data | {void*} 动态对象 |
ACL_API ACL_BTREE* acl_btree_create | ( | void | ) |
创建一个二叉树对象
ACL_API int acl_btree_depth | ( | ACL_BTREE * | tree | ) |
计算当前二叉树的深度
tree | {ACL_BTREE*} 二叉树对象 |
ACL_API int acl_btree_destroy | ( | ACL_BTREE * | tree | ) |
释放一个二叉树对象
tree | {ACL_BTREE*} 二叉树对象 |
ACL_API void acl_btree_dump | ( | ACL_BTREE * | b | ) |
ACL_API void* acl_btree_find | ( | ACL_BTREE * | tree, |
unsigned int | key | ||
) |
从二叉树中查询
tree | {ACL_BTREE*} 二叉树对象 |
key | {unsigned int} 查询键 |
ACL_API int acl_btree_get_max_key | ( | ACL_BTREE * | tree, |
unsigned int * | key | ||
) |
返回二叉树中最大的键
tree | {ACL_BTREE*} 二叉树对象 |
key | {unsigned int*} 键指针,存储结果,不能为空 |
ACL_API int acl_btree_get_min_key | ( | ACL_BTREE * | tree, |
unsigned int * | key | ||
) |
返回二叉树中最小的键
tree | {ACL_BTREE*} 二叉树对象 |
key | {unsigned int*} 键指针,存储结果,不能为空 |
ACL_API int acl_btree_get_next_key | ( | ACL_BTREE * | tree, |
unsigned int | cur_key, | ||
unsigned int * | next_key | ||
) |
由给定键,返回其在二叉树中的下一个邻近键
tree | {ACL_BTREE*} 二叉树对象 |
cur_key | {unsigned int} 当前给定键 |
next_key | {unsigned int*} 存储结果键的指针地址 |
ACL_API void* acl_btree_remove | ( | ACL_BTREE * | tree, |
unsigned int | key | ||
) |
从二叉树中删除
tree | {ACL_BTREE*} 二叉树对象 |
key | {unsigned int} 键 |