aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-08-06 15:39:46 +0200
committerThomas Schmucker <ts@its1.de>2020-08-06 15:39:46 +0200
commit87d83e87b6da4036149b73c9b9b6a6946fd6acc7 (patch)
tree9769a352bc46976df352f873c71affceefb4783f
parent1e97f0d76e2f2dd981d28c3c8f10b54fea394896 (diff)
downloaddata-structures-87d83e87b6da4036149b73c9b9b6a6946fd6acc7.tar.gz
data-structures-87d83e87b6da4036149b73c9b9b6a6946fd6acc7.tar.bz2
data-structures-87d83e87b6da4036149b73c9b9b6a6946fd6acc7.zip
Überflüssgen Prototypen entfernt
-rw-r--r--tree.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tree.c b/tree.c
index 8d4efe9..f8277cd 100644
--- a/tree.c
+++ b/tree.c
@@ -16,15 +16,7 @@ struct tree_node {
16 /* ggf. weitere Felder... */ 16 /* ggf. weitere Felder... */
17}; 17};
18 18
19static bool tree_isBstUntil(struct tree_node *tree, int min, int max); 19static bool
20
21bool
22tree_isBst(struct tree_node *tree)
23{
24 return tree_isBstUntil(tree, INT_MIN, INT_MAX);
25}
26
27bool
28tree_isBstUntil(struct tree_node *tree, int min, int max) 20tree_isBstUntil(struct tree_node *tree, int min, int max)
29{ 21{
30 if ( tree == NULL ) 22 if ( tree == NULL )
@@ -37,6 +29,12 @@ tree_isBstUntil(struct tree_node *tree, int min, int max)
37 tree_isBstUntil(tree->right, tree->key + 1, max); 29 tree_isBstUntil(tree->right, tree->key + 1, max);
38} 30}
39 31
32bool
33tree_isBst(struct tree_node *tree)
34{
35 return tree_isBstUntil(tree, INT_MIN, INT_MAX);
36}
37
40struct tree_node * 38struct tree_node *
41tree_insert(struct tree_node *tree, T key) 39tree_insert(struct tree_node *tree, T key)
42{ 40{