diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-08-06 15:39:46 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-08-06 15:39:46 +0200 |
| commit | 87d83e87b6da4036149b73c9b9b6a6946fd6acc7 (patch) | |
| tree | 9769a352bc46976df352f873c71affceefb4783f /tree.c | |
| parent | 1e97f0d76e2f2dd981d28c3c8f10b54fea394896 (diff) | |
| download | data-structures-87d83e87b6da4036149b73c9b9b6a6946fd6acc7.tar.gz data-structures-87d83e87b6da4036149b73c9b9b6a6946fd6acc7.tar.bz2 data-structures-87d83e87b6da4036149b73c9b9b6a6946fd6acc7.zip | |
Überflüssgen Prototypen entfernt
Diffstat (limited to 'tree.c')
| -rw-r--r-- | tree.c | 16 |
1 files changed, 7 insertions, 9 deletions
| @@ -16,15 +16,7 @@ struct tree_node { | |||
| 16 | /* ggf. weitere Felder... */ | 16 | /* ggf. weitere Felder... */ |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | static bool tree_isBstUntil(struct tree_node *tree, int min, int max); | 19 | static bool |
| 20 | |||
| 21 | bool | ||
| 22 | tree_isBst(struct tree_node *tree) | ||
| 23 | { | ||
| 24 | return tree_isBstUntil(tree, INT_MIN, INT_MAX); | ||
| 25 | } | ||
| 26 | |||
| 27 | bool | ||
| 28 | tree_isBstUntil(struct tree_node *tree, int min, int max) | 20 | tree_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 | ||
| 32 | bool | ||
| 33 | tree_isBst(struct tree_node *tree) | ||
| 34 | { | ||
| 35 | return tree_isBstUntil(tree, INT_MIN, INT_MAX); | ||
| 36 | } | ||
| 37 | |||
| 40 | struct tree_node * | 38 | struct tree_node * |
| 41 | tree_insert(struct tree_node *tree, T key) | 39 | tree_insert(struct tree_node *tree, T key) |
| 42 | { | 40 | { |
