您的位置:首页 > 其它

bi_search_tree.h

2010-09-15 22:33 120 查看
#ifndef __BI_SEARCH_TREE_H__
#define __BI_SEARCH_TREE_H__
/*
*说明:定义了二叉查找树的相关数据结构和几个基本操作
*作者:leaf
*时间:2010-09-08 15:55:37
*/

typedef int datatype;

struct bi_search_tree
{
datatype key;
struct bi_search_tree *left,*right;
};

typedef struct bi_search_tree bst_tree;

/*插入操作,value是待插入的值*/
bst_tree *bst_insert(bst_tree *root, datatype value);

/*查找,找到返回1,否则,返回0*/
int bst_search(bst_tree *root, datatype value);

/*删除节点值为value的节点,成功返回1,否则,返回0*/
int bst_delete(bst_tree *root, datatype value);

/*中序输出bst树*/
void bst_print(bst_tree *root);

#endif
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: