diff options
| author | Steve Lee <me@xiangyangli.com> | 2017-12-10 09:07:59 +0800 |
|---|---|---|
| committer | Steve Lee <me@xiangyangli.com> | 2017-12-10 09:07:59 +0800 |
| commit | b70153e861af2b1c51d07926b7829ba0a3264a6b (patch) | |
| tree | 485ed94456d36d974f77d360a7ffc51f404da950 /Computer_Science/data_structures/chapter_4/binary_search_tree.h | |
| parent | 6b7af76728de0dc087d3c1b2e3dd1eed4250d968 (diff) | |
| download | 42-b70153e861af2b1c51d07926b7829ba0a3264a6b.tar.xz 42-b70153e861af2b1c51d07926b7829ba0a3264a6b.zip | |
chap4 for data structure
Diffstat (limited to 'Computer_Science/data_structures/chapter_4/binary_search_tree.h')
| -rw-r--r-- | Computer_Science/data_structures/chapter_4/binary_search_tree.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Computer_Science/data_structures/chapter_4/binary_search_tree.h b/Computer_Science/data_structures/chapter_4/binary_search_tree.h new file mode 100644 index 0000000..da128f8 --- /dev/null +++ b/Computer_Science/data_structures/chapter_4/binary_search_tree.h @@ -0,0 +1,17 @@ +#ifndef _BINARY_SEARCH_TREE_H +#define _BINARY_SEARCH_TREE_H + +struct TreeNode; +typedef struct TreeNode *Position; +typedef struct TreeNode *SearchTree; +typedef int elem_t; + +SearchTree make_empty(SearchTree t); +Position find(elem_t x, SearchTree t); +Position find_min(SearchTree t); +Position find_max(SearchTree t); +SearchTree insert(elem_t x, SearchTree t); +SearchTree delete(elem_t x, SearchTree t); +elem_t retrieve(Position p); + +#endif /* _BINARY_SEARCH_TREE_H */ |
