Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 1 insertions, 1 deletions
-rw-r--r--Seminar10/README.md2
diff --git a/Seminar10/README.md b/Seminar10/README.md
index 735888f..f83973c 100644
--- a/Seminar10/README.md
+++ b/Seminar10/README.md
@@ -75,7 +75,7 @@ void updateHeight(Node<T>*& r) {
if(r == nullptr)
return;
- r->height = getHeight(r->left) + getHeight(r->right) + 1;
+ r->height = std::max(getHeight(r->left), getHeight(r->right)) + 1;
}
```