From f4c936d8be2fe3cc99f7c4bbaa84c2edb262bf44 Mon Sep 17 00:00:00 2001 From: Mann Mehta Date: Sat, 18 Apr 2020 08:17:56 +0530 Subject: [PATCH] Update dynamic_programming/tree_height.cpp Co-Authored-By: Christian Clauss --- dynamic_programming/tree_height.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dynamic_programming/tree_height.cpp b/dynamic_programming/tree_height.cpp index 18a02e68e..b9142b117 100644 --- a/dynamic_programming/tree_height.cpp +++ b/dynamic_programming/tree_height.cpp @@ -29,7 +29,7 @@ void dp_with_dfs(int u) { if (!visited[v]) { dp_with_dfs(v); - // selected maximum subtree height from all child. + // select maximum sub-tree height from all children. child_height = std::max(child_height, dp[v]+1); } } @@ -57,4 +57,3 @@ int main() { dp_with_dfs(1); std::cout << "Height of the Tree : " << dp[1] << std::endl; } -