From 177914c7be1a78bdc991d717f593284d54f2babb Mon Sep 17 00:00:00 2001 From: marina <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:50:59 -0700 Subject: [PATCH] add note on height --- trees/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/trees/README.md b/trees/README.md index 679aa4a..29fd54a 100644 --- a/trees/README.md +++ b/trees/README.md @@ -15,6 +15,18 @@
+#### find height + +
+ +```python +def height(root): + if not root: + return -1 + return 1 + max(height(root.left), height(root.right)) +```` + +
----