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
#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
相关文章推荐
- bi_search_tree.c
- Lowest Common Ancestor of a Binary Search Tree
- [LeetCode] Convert Sorted Array to Binary Search Tree, Solution
- LeetCode Covert Sorted List to Binary Search Tree
- Validate Binary Search Tree
- uva_10304 - Optimal Binary Search Tree(最优搜索二叉树)
- Binary Search Tree Iterator
- Leetcode 272. Closest Binary Search Tree Value II (Hard) (cpp)
- Convert Binary Search Tree to Doubly Linked List
- 99. Recover Binary Search Tree
- LeetCode108. Convert Sorted Array to Binary Search Tree
- leetcode之Lowest Common Ancestor of a Binary Search Tree
- [Leetcode] Recover Binary Search Tree
- 【leetcode】Recover Binary Search Tree
- leetcode-108. Convert Sorted Array to Binary Search Tree
- Leetcode:Recover Binary Search Tree
- [Leetcode] Validate binary search tree 验证二叉搜索树
- [LeetCode] Recover Binary Search Tree 解题报告
- LeetCode: Validata Binary Search Tree
- LeetCode – Refresh – Valid Binary Search Tree