diff options
1 files changed, 14 insertions, 0 deletions
| -rw-r--r-- | Seminar08/height.cpp | 14 |
diff --git a/Seminar08/height.cpp b/Seminar08/height.cpp new file mode 100644 index 0000000..97ba9ab --- /dev/null +++ b/Seminar08/height.cpp @@ -0,0 +1,14 @@ +#include"tree-utils.h" +#include<iostream> + +template<typename T> +size_t height(const Tree<T>* tree) { + if (!tree) + return 0; + + return 1 + std::max(heightOfTree(tree->left), heightOfTree(tree->right)); +} + +int main(){ + +} |
