diff --git a/trees/bt_height.py b/trees/bt_height.py new file mode 100644 index 0000000..65fa688 --- /dev/null +++ b/trees/bt_height.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# author: bt3gl + +def height(root): + if not root: + return -1 + return 1 + max(height(root.left), height(root.right)) +